I am trying to make one menu (with id# 60) load with a ul list id="globalnav" on the first top level ul list.

I have figured out this override in my template.php file:

function phptemplate_menu_tree($pid = 60) {
  if ($tree = menu_tree($pid)) {
    return "\n<ul id=\"globalnav\">\n". $tree ."\n</ul>\n";
  }
}

But this puts the ul="globalnav" on every ul in the menu tree... Can anyone show me how to modify this so it only puts the id on the first ul in the menu tree?

Many thanks!

Comments

drupalprojects’s picture

function phptemplate_menu_tree($pid=1){
  if ($tree = menu_tree($pid)) {
    $item = menu_get_item($pid);
    if ($item['title']=='Primary Links') {
      return "\n<ul id=\"menu\">\n". $tree ."\n</ul>\n";
    }
.................
,,,,,,,,,,,,,,
jeffrey.dalton’s picture

Thanks for the post but I am total php noob so I really need this spelled out completely.

This looks like it is for modifying the primarly links menu which is not what I am trying to do. I need to have the first ul get a custom id added called id="globalnav" and then leave the rest of the nested ul lists alone.

This needs to be done for an added menu which got the menu ID of 60 in drupal.

Any ideas are greatly appreciated.

Jeffrey Dalton
Creative Director & Founding Partner
BKJ Digital
https://bkjdigital.com

jeffrey.dalton’s picture

See this post for excellent solution: http://drupal.org/node/109823

Jeffrey Dalton
Creative Director & Founding Partner
BKJ Digital
https://bkjdigital.com

drupalgeek’s picture