Child Menus don't work, even when 'expand' is forced
By redDIRT on February 18th, 2009 at 04:49am
()
Using the $primary_links variable in page.tpl.php doesn’t include the child items, even when Expanded is selected in the Drupal menu config. I tried a number of different theme functions, but nothing seemed to work. What did work finally was calling from the page.tpl.php
print theme('menu_tree','primary-links');
For the id, I used the template.php function:
function phptemplate_menu_tree($tree) {
$id=strpos($tree,'href="/"')!==FALSE?' id="primarylinks"':'';
return '';
}
There’s probably a better way to do it, but that’s how I got the id for the main menu set to primarylinks, and default for the child menus.
Post new comment