You are here

function custom_breadcrumbs_taxonomy_nodeapi in Custom Breadcrumbs 6.2

Implements hook_nodeapi().

File

custom_breadcrumbs_taxonomy/custom_breadcrumbs_taxonomy.module, line 148
This module implements taxonomy_based breadcrumbs using a hybrid of methods developed for the custom_breadcrumbs and taxonomy_breadcrumbs modules. Breadcrumbs are provided for node and taxonomy term pages. If 'Use taxonomy hierarchy' is…

Code

function custom_breadcrumbs_taxonomy_nodeapi($node, $op, $teaser, $page) {
  if ($op == 'alter' && empty($teaser) && !empty($page)) {
    if (_custom_breadcrumbs_taxonomy_allowed_node_type($node->type)) {
      module_load_include('inc', 'custom_breadcrumbs_taxonomy');

      // Extract the most recently viewed term or the lightest term from lightest vocabulary assosciated with node.
      $term = custom_breadcrumbs_taxonomy_node_get_term($node);
      if ($term) {
        $terms = taxonomy_node_get_terms($node);
        _custom_breadcrumbs_taxonomy_set_breadcrumb($term->tid, $term->vid, FALSE, array(
          'node' => $node,
        ), $terms);
      }
    }
  }
}