Multiple contextual filters break expected breadcrumb structure

Created on 11 May 2023, almost 2 years ago
Updated 16 October 2023, over 1 year ago

Problem/Motivation

If you have a menu item linking to a contextual filter value on a view page display that has multiple contextual filters, the breadcrumb pattern adds an extra crumb to the breadcrumbs. For example, if you have a top level menu item that links to a view page display that has two contextual filters and the path in the menu links to "/myview/mytermname," the breadcrumbs for that menu item will add the view title as an extra crumb to your breadcrumbs. This looks like "Home -> My Menu Item Title -> My View Title" when I would expect the breadcrumb to look like "Home -> My Menu Item Title".

Steps to reproduce

  • Build a fresh Drupal site using the Standard profile so that your site has Basic Page and Tags already created
  • Install and enable menu_breadcrumb
  • Add a new Taxonomy to your site
  • Add two entity reference fields to Basic page: one for Tags and one for your new taxonomy
  • Create a node that use both Tags and your new taxonomy.
  • Create a new view. Make sure you create a page display for your new view
  • Add two relationships to your view page, both using the "Taxonomy terms on node" relationship. Configure one for tags and the other for your new taxonomy
  • Add two contextual filters to your view page, both using the "Taxonomy term: Name" filter. Configure one for the relationship you made with tags and the other for the relationship you made with your new taxonomy.
  • Get a path using the first level of contextual filter you just made. It should be something like /myview/mytermname. Add this path to the menu as a top level menu item
  • I would expect the menu item to look like "Home -> Menu Item Name." Instead, verify that your breadcrumbs look like "Home -> Menu Item Name -> View Title"

Proposed resolution

Ideally, this would be fixed so that only the menu paths and menu title are used in the breadcrumb. If that's not possible, maybe instead there could be a way to have a list of ignored paths for this module? I could have a fix to this bug by using easy_breadcrumb or another custom breadcrumb module, but menu_breadcrumb is overriding any customizations I make to my breadcrumbs.

πŸ› Bug report
Status

RTBC

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States angelamnr

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024