I have a view with one argument (Taxonomy: Term ID). My menu looks like:

Menu item (view)
-- submenu 1 (view/1)
-- submenu 2 (view/2)

There are some problems with breadcrumbs in such configuration. When I select Menu item everything is correct an I have:
Home >> Menu item

When I select submenu the breadcrumbs show:
Home >> Menu item >> view name >> taxonomy term name
instead of expected
Home >> Menu item >> submenu 1 or at least Home >> Menu item >> taxonomy term name

Comments

manuel garcia’s picture

Hi,

I am also seeing this issue.

I have a page view setup, to take arguments (content type), here is the situation:

The view url is example.com/resources

If I go to example.com/resources/videos (videos being a content type), i get the following breadcrumb:

Home › Resources › Resources ›

Both Resources links are pointing to example.com/resources, so my guess is that this part in views_set_breadcrumb($view) isn't acting properly:

  if ($view->args) {
    // Add a breadcrumb trail for each level of argument we're at.
    $url = $view->url;
    $args = array();
    $where = 1;
    foreach ($view->args as $level => $arg) {
      if ($view->argument[$level]['argdefault'] != 1) {
        $breadcrumb[] = l(filter_xss_admin(views_get_title($view, 'page', $args)), $url, NULL, NULL, NULL, NULL, TRUE);
        // For next round.
      }
      $args[] = $arg;
      if ($where && $where = strpos($url, '$arg')) {
        $url = substr_replace($url, $arg, $where, 4);
      }
      else {
        $url .= '/$arg';
      }
    }
  } 

I am not skilled enough in PHP to either afirm that this is where the problem lies with any type of confidence, nor (if that's the case) to figure out what in this code is broken, but perhaps someone more skilled will shared some light into this issue...

I am using custom breadcrumbs module, although I don't see it interfeering here since it only applies to content types (in their full node view), as far as I know.

Please reply if you need further information or testing to narrow down the bug/issue.

Thanks and greetings from Barcelona!

jajathejazzcat’s picture

I had the same issue but was able to solve it temporally by commenting out the following line (line: 1486)

//$breadcrumb[] = l(filter_xss_admin(views_get_title($view, 'page', $args)), $url, NULL, NULL, NULL, NULL, TRUE);

This gets rid of breadcrumbs generated by the views.module, and now I have a clean breadcrumb generated by the menu system only.

ryo’s picture

> jajathejazzcat

Yes, by commenting out the whole 1486 line, the problem is solved only if you set the menu items for the view pages's URL.
But instead, if you don't have menu items and specify the URLs with arguments directly on the address bar,
disappears the breadcrumb of the parent (no argument) view's title...

Thanks.

esmerel’s picture

Status: Active » Closed (fixed)

Given the age of this issue, I have to presume it's either figured out or no longer relevant.