Closed (fixed)
Project:
Drupal core
Version:
6.x-dev
Component:
menu system
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
31 Jul 2010 at 18:09 UTC
Updated:
8 Oct 2012 at 20:04 UTC
Jump to comment: Most recent
Comments
Comment #1
damien tournoud commentedThe menu system changed a lot between Drupal 5 and Drupal 6, so it would help if you could give us more details about what you intend to do.
Comment #2
blue92877 commentedHi Damien,
In my Drupal 5 installations I used theme_menu_tree($mid) to extract the menu item with that id as well as the entire tree of children, (grandchildren, etc) below it.
In migrating to drupal 6 I created my menus and tried to use the same code for the same functionality. However, it simply returns the $mid I feed into the argument instead of the HTML rendered $tree as specified in the API.
This was useful because there are some parts of my menu I would like to show on specific pages in blocks designated for that page (sub menus). The original functionality of theme_menu_tree() allowed me to do that easily.
Now, however, the only function I can find is menu_navigation_links($menu_name).
This works for top level menus, and I have to feed it the menu name instead of the menu id. But it does not allow me to extract children from a main menu to create a sub menu
Hope that clarifies.
Comment #3
dharmatech commentedThe Drupal Cookbook has a post on it:
http://drupal.org/node/685664
We tend to use Menu Block for a lot of our sites since it lets the administrator control the menu blocks.
If you still want to do it on your own for whatever reason, we've done this in the past in our template.php:
Then call it from theme_preprocess() in template.php:
and now you can use it in your page templates:
There's probably a bunch of different ways to accomplish the same thing depending on where/how you want to use the child menu.
Comment #4
blue92877 commentedHey, that's a great work around, thanks for the post!
Comment #5
Anonymous (not verified) commentedLooks like OP's question was answered.