Drupal - assign menu to block based on node type

Posted by ernie on Stack Overflow See other posts from Stack Overflow or by ernie
Published on 2010-06-02T11:33:21Z Indexed on 2010/06/02 11:33 UTC
Read the original article Hit count: 296

Filed under:
|
|
|

I want to assign a specific menu in left sidebar block, based on the node type of the page currently being displayed. I think it should look something like this, but I am stuck.

function my_module_nodeapi(&$node, $op) {
  switch ($op) {
    case 'view':
      if ($node->type == "large_reptiles") 
      {
        //menu_set_active_menu_name('menu_reptile_menu');
        //menu_set_active_item('menu_reptile_menu');
      }
    break;
  }  
}

© Stack Overflow or respective owner

Related posts about drupal

Related posts about menus