Hello!

I have the Section module installed so that i can make different tpl-files for each section on my page.
The problem I have is the following: Every section has it's own menu.

That means Section a displays menu A with the menu-points 1, 2, 3 and 4; Section b has menu B with 5, 6, 7 and so on..

Now I found a snippet which can display primary and secondary links:

  print theme('links', $primary_links);

Is it now possible to print my own menu with the same method?

Thanks in advance!
FallinHigh

Comments

rkdeveloper’s picture

menu_primary_links() returns all the primary links try this..

make it simple will make your life easy........
Ram

Balmung’s picture

$links1 = theme_menu_tree(menu id);
print $links1

and you can find out the menu id by going into Menu Editor in the Admin and Hover over "edit" and its the number at the end :) ie if it were 4:

$links1 = theme_menu_tree(4);
print $links1
FallinHigh’s picture

thanks a lot to balmung!

i have the path module activated so that there is no id but the given name behind the edit button...
is there also a solution where i can use this name instead the id?

if i try several possible menu-id's (1 - 10) i only get the number i use as output.. :(

chadcross’s picture

Yeah, I have this same problem. This worked fine in Drupal 5 but there is no ID anywhere in DRupal 6.

Tom-182’s picture

You guys can try this code:

print theme('links', menu_navigation_links('menu-footer-links',0));

Note:
menu-footer-links is the ID name of the custom menu on Drupal 6.

http://www.geektips.net

milesoldenburg’s picture

This method worked for me :D

Sc0tt’s picture

I added:

test begin
<?php
print theme('links', menu_navigation_links('editing-menu',0));
?>
test end

to my page.tpl.php file where 'editing-menu' is the machine readable name given to the menu. I have two menu items associated with the menu. I don't get anything except the test text. Any suggestions on how to get a custom menu to appear? I"m using Drupal v6.15
Thank you,
Scott

marcushenningsen’s picture

Scott, you need to put menu- in front of editing-menu so that the whole line reads:

print theme('links', menu_navigation_links('menu-editing-menu',0));

Marcus

Sc0tt’s picture

That worked!
Thank you Marcus.
Scott

U8IK’s picture

you can skip the ID altogether:
print theme('links', menu_navigation_links('menu-custom-name')); works just as good
where *custom-name* is the machine-readable name of the menu so you need to remember that after you create it.

topdillon’s picture

I am using D6.20 and I cannot see anything with any of the above instructions. The custom menu has the name accountmenu and I typed menu-accountmenu. What could be tripping me up?

print theme('links', menu_navigation_links('menu-accountmenu'));
topdillon’s picture

What worked for me is this. Thanks Agaric.

jweedman’s picture

@diwwin Thanks! Worked for me, too.

I'm using 6.20, and it seems that "diwwin's" comment (and URL he posted), seemed to do the trick for me. And it seems like the 'cleanest' approach as well, so just like $secondary_links and $primary_links, you can print out your $custom_menu.

heyehren’s picture

Hi all,

i've put together a tutorial on custom menus. I hope it helps a few people.

http://www.kleinermann.com.au/blog/add-a-custom-menu-in-drupal-6/