By mrf on
I feel like I've tried everything, and I still I am not having any luck at getting the classes and id's of my ul's to change.
The following code from template.php worked on a 4.7 site I developed a few months ago, but no matter what, I can't seem to get it to work in Drupal 5.
<?php
/********************************************/
function phptemplate_menu_tree($pid = 1) {
if ($tree = menu_tree($pid)) {
$output .= "<ul id=\"udm\" class=\"udm\">";
$output .= $tree;
$output .= "</ul>\n";
return $output;
}
}
/********************************************/
function phptemplate_menu_item($mid, $children = '', $leaf = TRUE) {
$children = str_replace("<ul id=\"udm\" class=\"udm\">","<ul>",$children);
return "\t<li id=\"item_".$mid."\">". menu_item_link($mid) . $children ."</li>\n";
}
?>
If I remove the menu_item function the class and id's are applied to all the children ul's but still not to the parent list.
I need to have these specific classes for my drop down menus to work properly.
I realize this is a kind of hacked together solution using str_replace, any ideas to make it cleaner?
Any help would be greatly appreciated!
Comments
Solved
Solution can be seen in this issue page:
http://drupal.org/node/141361