Like in menu_active_trail_breadcrumb() where Drupal core removes the latest item in the breadcrumb if it is equal to the current path, the theme should do the same before optionally adding the page title.

This is in particularly important if the first submenu item is the same as its parent which is often used for the main menu as the main menu item triggers the drop down and can't actually open the menu link itself.

A patch follows in a second.

CommentFileSizeAuthor
#2 breadcrumb_should_check-2628864-2.patch847 bytesjurgenhaas
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jurgenhaas created an issue. See original summary.

jurgenhaas’s picture

Status: Active » Needs review
FileSize
847 bytes
markhalliwell’s picture

Status: Needs review » Postponed (maintainer needs more info)

I'm confused... the actual breadcrumb items are from core, so it already pops off the current page (which is why there's a theme setting to add it back, although not as a link).

jurgenhaas’s picture

Status: Postponed (maintainer needs more info) » Needs review

Sample menu structure:

Top level: "About us" with 5 sub-items
First sub-item is also "About us" to make this item accessible

Breadcrumb: Home / About Us

In menu_get_active_breadcrumb we have 3 items and remove the latest:
- Home
- About Us
- About Us

In bootstrap_preprocess_breadcrumb we have 2 items, remove the latest and add the current title
- Home
- About Us <= link removed and added as title

This is just an example which shows that we should remove the latest item twice.

markhalliwell’s picture

Category: Bug report » Support request
Status: Needs review » Closed (works as designed)

So, you're manually adding this link. That isn't a bug.

There's several ways to overcome this particular issue, least of which is renaming the 2nd "About Us" to something like "Overview" or "Introduction".

Regardless, even if you didn't want to go this route, this kind of customization is site/design specific. You can override in a sub-theme.

jurgenhaas’s picture

Well, renaming the overview item wouldn't change the fact that the breadcrumb will then contain one item too much - from a UX point of view. And yes, we can solve that in subthemes, but the behaviour of the drop down main menu is very common in bootstrap and hence a global solution would have been nice.