Our designers were having trouble targeting menu items via CSS. Drupal will label the first and last items in a list, and leave the ones in the middle plain vanilla! So to stop the wailing and gnashing of teeth, I had to modify menu.inc . I know it's bad, I didn't want to do it... they made me.

I made a change to the function menu_tree_output on line #737 (Drupal 6.14). I added this under line #754:

if ($i > 0 && $i < $num_items - 1){
$extra_class = 'list'.$i;
}

Could something like this find it's way into the next release, or is there a better way to give menu list items some sort of uniqueness? Is there a way to put this into template.php?

Comments

eeyorr’s picture

Not exactly what you're asking for, but you can wrap your menus in a module like Nice Menus to add unique classes to each menu item.

mdupont’s picture

Status: Active » Closed (works as designed)

Old issues, and theme overrides or custom modules are the solution. Closing.