=== modified file 'includes/menu.inc' --- includes/menu.inc 2010-11-07 21:51:40 +0000 +++ includes/menu.inc 2010-11-14 20:27:35 +0000 @@ -1207,6 +1207,7 @@ function menu_tree_page_data($menu_name, $tree_parameters['expanded'] = $active_trail; $tree_parameters['active_trail'] = $active_trail; } + drupal_alter('menu_tree_active_trail', $tree_parameters, $cid); // Cache the tree building parameters using the page-specific cid. cache_set($cid, $tree_parameters, 'cache_menu'); } === modified file 'modules/system/system.api.php' --- modules/system/system.api.php 2010-11-13 02:00:56 +0000 +++ modules/system/system.api.php 2010-11-14 20:32:45 +0000 @@ -1186,6 +1186,25 @@ function hook_translated_menu_link_alter } /** + * Alter the current page menu tree parameters like the active trial. + * + * While menu_set_active_trail() can be used to set the active trail it only + * affects the breadcrumb. This alter can be used to change the menu link + * ids stored in $tree_parameters['active_trail'] indicating which links in + * the page menu should be open. + * + * @param $tree_parameters + * See menu_build_tree() for the description of this array. + * @param $cid + * The cache id for these parameters. Add your identifiers separated by + * colons as necessary. + */ +function hook_menu_tree_active_trail_alter(&$tree_parameters, &$cid) { + // Only show the three levels of the menu. + $tree_parameters['max_depth'] = 3; +} + +/** * Inform modules that a menu link has been created. * * This hook is used to notify modules that menu items have been