Hi, I've spent a lot of time trying to find how to create unique ID for each menu. Let's say I've created some new menus in Administration -> Menu. In page.tpl.php I use this way to insert primary (or secondary) menu:

print theme('menu_links', $secondary_links, array('id' => 'blue', 'class' => 'side-menu'));

Is there any way how to use the same or similar piece of code for my other menu - where can I find how other menus are called? I guess if I knew the name of the array with each menu I would just put there this:

print theme('menu_links', $XXXXXXXXXXX, array('id' => 'blue', 'class' => 'side-menu')); // where $XXXXXXXXXXX is new menu

Is it right? But I don't know where to find it...can anyone please help me with this?

-------------------------------------------------------------------------------------

The other way I was thinking about is to insert that menu in Administration -> Block...to choose the block with my menu and region where I want to insert it. But in this case I would need to change function theme_menu_tree because I need every menu to have different ID - in this function there is only "ul class="menu"", which is used for every menu. Does anyone know how to create unique ID (or class) for every single menu? E.g. my menu is called "other-info" (it's the title I used when creating new menu) - how to use this title to create that ID - to have "ul id="other-info""???

Hope it's clear what i'm trying to do...

Thanks for any help!!!

Comments

krishikesh’s picture

jiri.prokes’s picture

Thanks for your reply, but it shows how to work with primary and secondary menu only...if I'm not wrong.

I need something a bit different...I have 4 menus on my site and need to put them either in page.tpl.php in the same way as primary (secondary) links - as shown above, or to use admin -> block but to be able to give unique ID to each menu (that ID should be same as title of the menu if possible)...

havran’s picture

Maybe you looking something like this: http://www.drupal.cz/forum/jak-na/taxanomy-obsah-hlavneho-menu#comment-9384 (Slovak language). If you have a question feel free to ask.

--
My blog - Havran's mini-blog
My first drupal site - http://www.enigma.sk/

--
My site - Svoji.SK
My first Drupal site - http://www.enigma.sk/

bombadillo’s picture

Really, i'm a bit surprised that this thing is so much complicated.
I' think that it could be done if someone knows a way to get the current menù id when the theme_menu_tree function is called.

I'm also struggling to do this thing but i'm about to give up, 'cause no one seems to know anything about this and i can't figure out.

:(

lloyyd’s picture

I got the same problem like you and I can't find any function that helps us :(
and the best thing is that this is the last thing that my page needs :(

lloyyd’s picture

mhm, you don't know how to get the menu ID? you can see them at the drupal database, how do you think you can get that to work with the menu ID? tell me :D