changing menu template

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Post Reply
Wishbone
Power Poster
Power Poster
Posts: 1368
Joined: Tue Dec 23, 2008 8:39 pm

Re: changing menu template

Post 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.
uniqu3

Re: changing menu template

Post 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}
Wishbone
Power Poster
Power Poster
Posts: 1368
Joined: Tue Dec 23, 2008 8:39 pm

Re: changing menu template

Post by Wishbone »

Even better! I forgot about the smarty looping position indicators.
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: changing menu template

Post by Dr.CSS »

Post Reply

Return to “CMSMS Core”