| 7 menu.inc | theme_menu_tree( |
| 4.6 menu.inc | theme_menu_tree($pid = 1) |
| 4.7 menu.inc | theme_menu_tree($pid = 1) |
| 5 menu.inc | theme_menu_tree( |
| 6 menu.inc | theme_menu_tree( |
| 8 menu.inc | theme_menu_tree($variables) |
Returns HTML for a wrapper for a menu sub-tree.
Parameters
$variables: An associative array containing:
- tree: An HTML string containing the tree's items.
See also
template_preprocess_menu_tree()
Related topics
File
- includes/
menu.inc, line 1612 - API for the Drupal menu system.
Code
function theme_menu_tree($variables) {
return '<ul class="menu">' . $variables['tree'] . '</ul>';
}
Comments
Targeted Override
PermalinkI don't see it documented elsewhere that you can implement a
THEMENAME_menu_tree__MENU_NAME()function as an override for a specific menu.See http://drupal.org/node/254940#theme-suggestions-for-menus.
Thanks a million!
PermalinkThanks a million!
No context
PermalinkThis function doesn't provide any context information like level or block id. This is a problem when you display the same menu in different block.
But you can use hook_block_view_alter to change the theme_wrapper.
I made a small example here https://gist.github.com/3201854
Thanks Gargarine!
PermalinkThanks gargarine, that was exactly what I needed!
THEMENAME_menu_tree__MENU() works
PermalinkSee http://drupal.org/node/1938044#comment-7160032