You are here

function _taxonomy_menu_node_view in Taxonomy menu 5

Same name and namespace in other branches
  1. 6 taxonomy_menu.inc \_taxonomy_menu_node_view()

Generates the breadcumb for nodes that have a category listed as a menu

Parameters

Object. The node object:

Array. The list of all taxonomy vocabs and: terms that this node have and are also menus

1 call to _taxonomy_menu_node_view()
taxonomy_menu_nodeapi in ./taxonomy_menu.module
Implementation of hook_nodeapi().

File

./taxonomy_menu.inc, line 230
taxonomy_menu.inc @author Jonathan Chaffer <jchaffer@structureinteractive.com> @author Bruno Massa <http://drupal.org/user/67164> It Generates menu links for all taxonomy terms

Code

function _taxonomy_menu_node_view(&$node, &$vocabs) {
  foreach ($vocabs as $vid => $vocab) {
    if (variable_get('taxonomy_menu_hide_module_page', FALSE)) {
      $path = $vid;
    }
    else {
      $path = variable_get('taxonomy_menu_display_page', 'category') . '/' . $vid;
    }
    $getvoc = taxonomy_get_vocabulary($vid);
    $breadcrumb_items = array(
      'path' => $path,
      'title' => t($getvoc->name),
    ) + _taxonomy_menu_get_term_breadcrumb_items($vocab[0], $path) + array(
      'path' => 'node/' . $node->nid,
      'title' => $node->title,
    );
    menu_set_location($breadcrumb_items);
    return;
  }
}