/ Published in: PHP

initial code and concept bitten from: http://drupal.org/project/menutrails
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
/** * Implementation of hook_nodeapi(). * * This will evaluate individual nodes when being viewed and take the necessary * steps to set the active_trail for menus. * * This will retain menu state at the node/view level. For instance, forum nodes * would maintain an active trail to the forum menu item. */ function hook_nodeapi(&$node, $op, $a3 = NULL, $page = FALSE) { if ($op == 'view' && $page == TRUE && $node->type == 'your-type') { // IF YOU HAVE ALIAS AND NOT INTERNAL PATH /// $path = drupal_lookup_path('source',$url); $item = menu_get_item('internal-drupal-path'); if ($item) { menu_set_item(null, $item); } } }
Comments
