I was wondering if a {count} variable could be added to the static_tome_path plug-in for the Tome module. Basically, I’m trying to spit out a nav that looks like this, where each link is given a unique class based on {count}:
<div id="mainnav">
<ul>
{exp:static_tome_path direction="post" page="0" depth="1" nest="false"}
<li><a href="http://{url_title}class=page_{count}">{title}</a></li>
{/exp:static_tome_path}
</ul>
</div>
Or is there a way I can fake a {count} variable using PHP in my template?
Well, my PHP isn’t what it should be, but a bit of experimenting paid off. So simple it hurts:
<?php $count = 1; ?>
<div id="mainnav">
<ul>
{exp:static_tome_path direction="post" page="0" depth="1" nest="false"}
<li><a href="http://{url_title}class=page_<?=$count++?>">{title}</a></li>
{/exp:static_tome_path}
</ul>
</div><!-- #mainnav -->
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.