menu_tree is not themable

spatz4000 - November 21, 2008 - 21:44
Project:Drupal
Version:5.12
Component:theme system
Category:support request
Priority:normal
Assigned:Unassigned
Status:by design
Description

http://api.drupal.org/api/function/theme_menu_tree/5 says to me that menu_tree is themeable via template.php. However when I try that in template.php, my customizations do not take.

So is menu_tree actually themeable?

#1

dvessel - November 22, 2008 - 18:53
Category:bug report» support request
Status:active» by design

menu_tree is not directly themable. theme_menu_tree *is* themable.

within template.php:

<?php
function themeName_menu_tree($pid = 1) {
 
// menu_tree() will return list items.
  // See theme_menu_item() and theme_menu_item_link()
  // to theme the child elements returned by menu_tree().
 
if ($tree = menu_tree($pid)) {
    return
"\n<ul class=\"menu\">\n". $tree ."\n</ul>\n";
  }
}
?>

#2

spatz4000 - November 24, 2008 - 14:47

So I call it like this:

$pi = 496;
print menu_tree($pi);

The template.php has this code:

function bluemarine_menu_tree($tree) {
return "\n<ul class=\"LFs\">\n". $tree ."\n</ul>\n";

}

But when I examine the source for the page that calls menu_tree my class ( LFs ) I don't see ul class="LFs" All I really want to do is have each menu item print out on a new line.

 
 

Drupal is a registered trademark of Dries Buytaert.