Is there a way to instruct Drupal 6 to show a certain menu without actually putting the node you are viewing into that menu?
I'm using primary links as the source of secondary links and I'd like to instruct Drupal that "this node I'm viewing is associated with this menu item" so that the correct combination of primary and secondary links is displayed. I can achieve this by just putting all the relevant nodes as third-level menu items, but then I've got a LOT of stuff in my menu (I've got about 700 nodes).
John Fletcher wrote:
Is there a way to instruct Drupal 6 to show a certain menu without actually putting the node you are viewing into that menu?
I’m using primary links as the source of secondary links and I’d like to instruct Drupal that “this node I’m viewing is associated with this menu item” so that the correct combination of primary and secondary links is displayed. I can achieve this by just putting all the relevant nodes as third-level menu items, but then I’ve got a LOT of stuff in my menu (I’ve got about 700 nodes).
On the relevant pages, you can do the following to construct the menu for a different path (say, for example, node/7) in template.php (in your theme_preprocess_page() function).
menu_set_active_item('node/7');
// build secondary links $vars['secondary_links'] = menu_secondary_links();
// reset active item menu_set_active_item($_GET['q']);
Cheers,
Jonathan