For example, I have “node/31”. And I want drupal to set menu active item to “galleries/lastgallery” if node/31 is viewed. How to do it?
<?php
function custom_nodeapi (&$node, $op, $a3 = NULL, $a4 = NULL){
if ($op == 'view' && $node->nid == 31) {
???
}
}
?>
Updated:
I know I can use menu_set_active_item. But in this case tabs (View/Edit etc. tabs) will be not displayed. I believe it should be done with menu_set_active_trails, or may be menu_get_item/menu_set_item somehow, but I can’t figure how exactly.
For similar purpose, I used
menu_set_item(). You should leave the$pathargumentNULLand use the menu item for the internal path of'galleries/lastgallery'as$router_item.