2

On my site i have the weird problem that for one of the menu pages the breadcrumb shows as one lvl deeper than the page it's on.

So it's showing: Home > Page i'm on > subpage i'm not on instead of: Home > Page i'm on

In addition, contrary to other pages i have, the bottom level of the breadcrumb is clickable which makes no sense, as that's supposed to be the page i'm on (wel it's not due to the above described error, but anywho).

I've no breadcrumb-modules installed. I do have a hook to modify the breadcrumbs like so:

function mytheme_breadcrumb(&$variables) {
  if (isset($variables['breadcrumb']) && !empty($variables['breadcrumb'])) {
    $crumbs = '<ul class="horizontal-list horizontal-list--multilevel">';
    $breadcrumb = $variables['breadcrumb'];
    $array_size = count($breadcrumb);
    $i = 0;
    while ( $i < $array_size) {
     $crumbs .= '<li class="';
     if ($i+1 == $array_size) { $crumbs .= 'horizontal-list__last'; }
     $crumbs .=  '">' . $breadcrumb[$i] . '</li>';
     $i++;
    }
    $crumbs .= '</ul>';
    return $crumbs;
  }
}

Doesn't look like the theme_breadcrumb function is responsible, as it uses the values it's getting from drupal by standard.

Anybody any ideas as to what might be causing this?

0

Is it possible that there is an old link to this page in your menu that is nested in the tree like. home -page --MY-PAGE

Because breadcrumbs seem to use the menu tree to build the breadcrumb items.

| improve this answer | |
  • This was indeed it: one of the descendants of that item (two levels down) had a link to this item still from when i entered it as dummy content. Changing the url of that item resolved it :-) Much appreciated! I'd upvote you, but sadly my reputation isn't high enough yet :( – Koen Cornelis May 13 '15 at 15:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.