You are here

function _taxonomy_CrumbsPlugin__term_node::findParent__node__ in Crumbs, the Breadcrumbs suite 6

Nodes get their terms as breadcrumb parents. The method name matches the router path "node/%".

File

plugins/crumbs.taxonomy.inc, line 60

Class

_taxonomy_CrumbsPlugin__term_node

Code

function findParent__node__($path, $item) {
  $node = $item['map'][0];
  if (is_array($node->taxonomy)) {
    $result = array();
    foreach ($node->taxonomy as $tid => $term) {
      if (!isset($result['voc_' . $term->vid])) {
        $result['voc_' . $term->vid] = "taxonomy/term/{$tid}";
      }
    }
    return $result;
  }
}