Pasar al contenido principal
x
Menu Breadcrumb: Generate breadcrumbs based on menu position/titles.

On the module Settings page, select options regarding the apperarance of breadcrumbs, and select menus on which to generate menu-based breadcrumbs. This basic behaviour is similar to the Drupal 7 version, which in Drupal 8 is extended as follows:

  • If the "Taxonomy Attachment" option is selected for a menu, and if the current page belongs to a taxonomy on that menu, it will inherit the taxonomy page's menu breadcrumbs (e.g., to provide breadcrumbs for blog entries that aren't on menus themselves).
  • If the "Language Handling" option is selected for a menu, the menu will not be breadcrumbed unless its defined language matches the current content language (recommended when you use a separate menu per language).
  • When the current page cannot be breadcrumbed according to the menu selections, it will not generate a breadcrumb at all, and another breadcrumb builder of lower priority will be free to generate the breadcrumb.

When a "taxonomy attachment" is found, the breadcrumbs will reflect the menus only and NOT the any hierarchy within the taxonomy: yet if those taxonomy terms are posted in a hierarchical menu then they will breadcrumb in the same way. (For menus based automatically on a taxonomy hierarchy, with breadcrumbs reflecting the same hierarchy, you could use the Taxonomy Menu module.)

Implementation Notes

If the current page exists on more than one menu, or has more than one possible taxonomy attachment, it uses the first box selected in the ordered list of menus. The order in which menus are scanned can be changed by dragging & dropping the menus on that list.

If the current page exists more than once on the same menu, the active_trail service returns more than one menu trail but the breadcrumb builder has no definitive way of choosing which corresponds to the chosen menu path (currently it will return the one with the lowest Menu Link ID: generally the oldest on the menu). If the duplication cannot be avoided by moving the duplicates to separate menus and setting menu priorities appropriately, you can try setting the active_trail of duplicated items by context (e.g. Context Active Trail) instead of adding them more than once your menu (see Issue 3113126).

Taxonomy terms are searched in the order that their entity reference fields appear in the current page's field listing. One way to change an unwanted taxonomy term taking precendence over the one on which you want to "attach" would be to change the order of those fields.

When the current page displays the breadcrumbs of its taxonomy parent, the breadcrumb for that taxonomy is always a link regardless of the "Show current page as link" option. (This can be confusing until we remember that this breadcrumb is not for the current page, and must be a link because the current page is no anchored at all in the menu… unlike a breadcrumb that isn't taxonomy-attached.)