Page 1 of 1

How to determine the last item in a menu?

Posted: Fri Sep 07, 2007 5:58 am
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.

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

Posted: Fri Sep 07, 2007 7:14 am
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.