like term-->subterm, CB should gracefully default to the lowest term in a tree hierarchy. Now it just freaks out and displays "Taxonomy Term" with a link /taxonomy/term instead of trying to fight and display something.

Comments

dlx’s picture

Title: When using [term] and trying to resolve term taxonomy path, » I looked at this issue closer
Status: Active » Closed (fixed)

and it seems that the problem is not with custom breadcrumbs, but with views.

If breadcrumbs are generated using a subterm, it just outputs "Taxonomy term" as the breadcrumb.

However, if the page is generated without views (just a straight listing of nodes for a subterm), everything works fine.

Closing this issue.

dlx’s picture

Title: I looked at this issue closer » Ok, it seems that
Status: Closed (fixed) » Active

the problem is in CB. custom_breadcrumbs_nodeapi($node, $op, $teaser, $page) function is causing that behaviour. If I leave just if ($op == 'view') It outputs too much stuff in a breadcrumbs on some of the pages, but fixes the breadcrumbs on pages generated with views.

function custom_breadcrumbs_nodeapi($node, $op, $teaser, $page) {

      if ($op == 'view' && !$teaser && $page) {                           <<<<<<<<<<<<<<<<<<<<PROBLEM HERE<<<<<<<<<<<<<<<<<<<

      if ($breadcrumb = _custom_breadcrumbs_load_for_type($node->type)) {
        $titles = explode("\n", $breadcrumb->titles);
        $paths = explode("\n", $breadcrumb->paths);

        $titles = module_exists('token') ? token_replace($titles, 'node', $node) : $titles;
        $paths = module_exists('token') ? token_replace($paths, 'node', $node) : $paths;

        $trail = array(l(t('Home'), ''));
        for ($i = 0; $i < count($titles); $i++) {
        // skip empty titles
          if ($title = trim($titles[$i])) {
            $trail[] = l($title, trim($paths[$i]));
          }
        }
        drupal_set_breadcrumb($trail);
    }
  }

}

Any idea how to change the line above so CB would work with views?

Thanks!

Christefano-oldaccount’s picture

Title: Ok, it seems that » CB should default to lowest term in a tree hierarchy when using [term]

Changing title.

eaton’s picture

Status: Active » Closed (works as designed)

There seems to be some confusion about how Custom Breadcrumbs works. It should only generate breadcrumbs when on the single-node viewing page at the www.example.com/node/$nid url. Any other breadcrumb trails (on a view page for example) are being generated by the Views module, not Custom Breacrumbs.