Page 1 of 1

Re: changing menu template

Posted: Tue Dec 07, 2010 3:57 pm
by Wishbone
You have the $count variable that tells you how many items you have. You can define another variable that increments after each menu item. After this variable equals $count, you can put a different class on that last item.

Or you can cheat and put a value in extra1 indicating that this is the last page, then test for this in your template.

Re: changing menu template

Posted: Tue Dec 07, 2010 4:25 pm
by uniqu3
Or like this
{foreach from=$nodelist item=node name=menuitem}

url}"{if $smarty.foreach.menuitem.last} class="last-menu-item"{/if}>{$node->menutext}
{/foreach}

Re: changing menu template

Posted: Tue Dec 07, 2010 4:58 pm
by Wishbone
Even better! I forgot about the smarty looping position indicators.

Re: changing menu template

Posted: Tue Dec 07, 2010 5:47 pm
by Dr.CSS