How to determine the last item in a menu?

For discussion and questions related to CMS Specific templates and stylesheets (CSS), and themes. or layout issues. This is not a place for generic "I don't know CSS issues"
Post Reply
reflectiondigital
New Member
New Member
Posts: 5
Joined: Thu Jul 12, 2007 3:48 am

How to determine the last item in a menu?

Post by reflectiondigital »

I have a horizontal menu with a separator between each item created using the border-right css property.  I don't want the last item in the menu to have the border, but I can't figure out how to determine whether a menu item is the last one or not.  Is there a $node property for this?

thanks!
leslye.
cyberman

Re: How to determine the last item in a menu?

Post by cyberman »

Have you tried to compare $count with $node->index  ;) ?

$count contains the amount of menu elements.
$node->index contains the number of every menu element.

Note: $node->index begins with element 0 so the maximum value of it has a difference of 1 to $count.
Post Reply

Return to “Layout and Design (CSS & HTML)”