So I would need to remove the rule from all of my CSS panels for the individual products. Currently, the horizontal rule between the products IS built into the CSS for each of three products across a row. In other words, there are actually three separate horizontal rules coming together to make the appearance of one long rule all across the row.
No you don't need to remove the rule, you just need to put it at the top instead of the bottom and you need to not include the CSS rule for the first row of products.
I thought my idea with saying if there are X more products, use the CSS box with the bottom rule, if not use the CSS box without the bottom rule was cleaner and would not require me to change the CSS for the product boxes.
Good idea but there is no way to determine the "X more products"
Isn't there then a way for Shopsite to know there are X number of products assigned to the page, so therefore it could know which CSS box to use?
ShopSite knows how many products there are but there is no evaluator operators in the template language other than saying if two values are equal [-- if x y --] syntax where it looks at x and y and if they are the same it returns true and if not it is false. So in order to determine if there are more products you would need to check [-- productsonpage 1 --], [-- productsonpage 2 --] [-- productsonpage 3 --] [-- productsonpage n --] etc which would be to cumbersome to do.
If not, I'll have to remove the bottom rule CSS. Then, it looks to me like I'd need to add a rule somehow to run after every 3 products. I guess I could add that by writing some css calling for a rule after the third product in the template?
Yes that is what I was trying to explain how to do. You know when you output the code to make a new row just add the CSS at that point.
A VAR is just a variable and can be used at any point to check or set the value of something. For example [-- VAR.first yes --] just creates a variable called "yes". [-- IF VAR.first yes --] checks the value of variable, VAR.first, to see if it is set to "yes". [-- VAR.first no --] resets the value of the variable to "no" instead of "yes". Using this method you can see what the value is and execute different code depending on the state of the variable.
Some thing like this would be in your product template.
- Code: Select all
[-- IF VAR.first yes --]
just output the normal product information
[-- product.name --] [-- product.price --] etc what ever your code currently does to display the product information.
[-- else --] (var.first is not equal to yes)
put out your CSS for the rule
now put out the product information
[-- product.name --] [-- product.price --] etc what ever your code currently does to display the product information.
[-- END_IF --]
Something like this would be in your page template.
- Code: Select all
[-- define page --]
. . .
[-- VAR.first yes --]
[-- loop products --]
[-- product --]
your code to see if you need to output a new row
if you did then you need to change VAR.first to no
[-- VAR.first no --]
[-- end_loop products --]
clean up VAR.first so we're ready for next time around
[-- VAR.first yes --]
. . .
[-- end_define page --]
NOTE: the ShopSite template tags are not case sensitive so you can have [-- VAR.first --] or [-- Var.First --] or [-- var.first --] or [-- VaR.fIrSt --] and they all mean the same thing.
In order to be more exact I would need to have both your page and product templates to see where thing would need to change. That is a bit much for the forum so if you need to do that please send them by way of the Email option on the bottom of the post.