Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
If the parent menu item has the same link as one of it's children, only the parent is being added to the breadcrumb. It would make sense if the child menu item would be added as well. We could also add an option to disable this behaviour.
Comments
Comment #2
Lukas von BlarerComment #3
rphair CreditAttribution: rphair at COSD commenteddear @Lukas, you probably already know this module gets the breadcrumb trail from the Menu Active Trail in Drupal 8 as described in MenuActiveTrail::getActiveTrailIds.
Any breadcrumb builder working in the current page will run that method on the route to the current page, which in your case would be the same for both the parent & child: also, more generally, for all duplicate appearances of a link anywhere "later" on the menu than the "first" -
getActiveTrailIds()
returns the first match but I don't know by what ordering.Therefore the only way we could properly update this module is to appeal to the maintainers of the menu system that
getActiveTrailIds()
should return multiple responses, with multiple active trails, for each menu item when the route of the current page appears on a menu multiple times.Using any other method than the Menu Active Trail would effectively mean that Menu Breadcrumb would no longer be menu-based. I believe there is good support in this module's community for relying upon the Drupal 8 services even when they aren't perfect.
For other pathological cases we have allowed the breadcrumbs to be produced by an active trail set by context, which I think would work for your case, according to issue 2804943. If that works, it would help progress all these issues as a whole if you posted your workaround here, perhaps helping any core issue petition for the MenuActiveTrail service to support multiple active trails on the same menu.