Hi,
I’m using the following code to make a grid of products, 3 columns across:
{switch='<div class="row">||'}
<div class="column">
{product_name}
{product_price}
</div>
{switch='||</div>'}
{if count == total_results}
</div>
{/if}And it works fine. It gives me:
item 1 - item 2 - item 3
item 4 - item 5 - item 6
item 7 - item 8 - item 9
However, if I wrap the code in a conditional (so that only ‘available’ products are shown):
{if product_available == "Available"}
{switch='<div class="row">||'}
<div class="column">
{product_name}
{product_price}
</div>
{/if}
{switch='||</div>'}
{if count == total_results}
</div>
{/if}And if it’s the case that ‘item 2’ is not ‘available’, then it gives me:
item 1 - item 3
item 4 - item 5 - item 6
item 7 - item 8 - item 9
So it looks like it populates the grid with all items, then parses the conditional and removes the ones that don’t match it. Or something like that.
Instead of using the Switch tag, I’ve tried modulo and also the EE Grouper plugin with the same results.
Thanks for any ideas.