views:

1015

answers:

3

For the menu system, is there a way to set one of the menu items to be expanded by default? I can't get my home menu item to be expanded on the homepage (at the least), and I'd like it to be expanded whenever one of the other ones isn't.

I'm using Drupal 5, and the Taxonomy Menu module. Taxonomy Menu is pretty good with 95% of my pages, but some are static "About Us" type pages, which I'd like to have the home menu as default for, and then there's the homepage.

+1  A: 

Well, I think I found a (sad) answer. From an issue on the Drupal webpage, "as it appears, the menu system of Drupal 5 is broken and won't be fixed anymore". So I'm finding a new way to do the top navigation that goes outside of Drupal's menu system.

Solution: I ended up putting the navigation system in page.tpl.php. Based on the content of the nodes (I'm pulling the taxonomy from the breadcrumb), it chooses which one is highlighted, but defaults to home. It's hackier than I'd like, but it works.

Dan G
A: 

It might be worth upgrading to Drupal 6 if you don't have too much invested in Drupal 5. Then all you have to do is administer the relevant menu and tick the "Expanded" option for it...

x3ja
The expanded option is in Drupal 5 also, but it keeps it always expanded.
Dan G
+1  A: 
/**
 * Implementation of hook_menu_link_alter().
 *
 */
function module_menu_link_alter(&$item, $menu) {
    if($item['menu_name'] == 'primary-links') {
        $item['expanded'] = 1;
    }
}
Jerome Jaglale

related questions