I am using ExpressionEngine 2.10.3 and also Taxonomy 3 plugin. I have the following code which, when run, returns the 15 nodes I have set up:
<div class="col-md-4">
{exp:taxonomy:nav tree_id="1" display_root="no" root_node_id="2"}
<li>
<a href="http://{node_url}">{node_title}</a>
</li>
{/exp:taxonomy:nav}
</div>
What I would like to do is after every 5 entries, end the current <div>
and start a new col-md-4
. Usually, I would use {switch}
and I have tried it like this:
<div class="col-md-4">
{exp:taxonomy:nav tree_id="1" display_root="no" root_node_id="2"}
<li>
<a href="http://{node_url}">{node_title}</a>
</li>
{switch='||||</div><div class="col-md-4">'}
{/exp:taxonomy:nav}
</div>
But it doesn’t work at all, instead it just prints out {switch='||||'}
Is there any way of doing what I’m trying to do?
Thanks in advance, Andy
Here’s a solution to your problem. Replace switch with this:
{if count % 5 == 0}</div><div class="col-md-4">{/if}
See Conditional Tags for more info.
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.