function menutrails_nodeapi in Menu TrailsMenu Trails 6
Same name and namespace in other branches
- 5 menutrails.module \menutrails_nodeapi()
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.
File
- ./
menutrails.module, line 70 - Menutrails allows the assignment of "trails" which will keep menu items active for individual node views.
Code
function menutrails_nodeapi(&$node, $op, $a3 = NULL, $page = FALSE) {
if ($op == 'view' && $page == TRUE) {
$item = menutrails_node_location($node);
if ($item) {
menu_set_item(NULL, $item);
if (variable_get('menutrails_breadcrumbs', 1)) {
drupal_set_breadcrumb(menutrails_get_breadcrumbs());
}
}
}
}