function theme_menu_tree

You are here

7 theme_menu_tree($variables)
4.6 theme_menu_tree($pid = 1)
4.7 theme_menu_tree($pid = 1)
5 theme_menu_tree($pid = 1)
6 theme_menu_tree($tree)
8 theme_menu_tree($variables)

Returns HTML for a wrapper for a menu sub-tree.


$variables: An associative array containing:

  • tree: An HTML string containing the tree's items.

See also


Related topics


includes/, line 1612
API for the Drupal menu system.


function theme_menu_tree($variables) {
  return '<ul class="menu">' . $variables['tree'] . '</ul>';


I don't see it documented elsewhere that you can implement a THEMENAME_menu_tree__MENU_NAME() function as an override for a specific menu.


This 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