Breadcrumb

This article contains information regarding breadcrumbs.

The breadcrumb is a type of secondary navigation that reveals the user’s active trail and location in a website.

There was a functional change with the way breadcrumbs work from Drupal 7 to Drupal 9. The breadcrumb is now based on a node's path alias instead of the hierarchy of the menu items. This introduced specific behaviour for how breadcrumbs are generated.

  • A breadcrumb item will use the menu item's title when available, and the page title as fall back
  • A breadcrumb item will generate a path alias based on the menu item's title
  • A breadcrumb item will only be a link if the path alias it leads to is valid
  • A breadcrumb will determine if a page alias is valid by checking if the path alias it generated based on the menu title matches the destination (path alias of the page)

 

This is why it is best practice to allow automatic generation of paths based on title for pages and ensuring the menu item matches the title of the page (which it does by default if you select provide link when editing the page. For manual menu item creation through the menu settings ensure to provide the same title). 

Overrides and customizations of page titles/menu titles/paths without careful consideration could lead to breadcrumb items determining the path as invalid and only render as text. 

Here is short list of things that can affect a mismatch of titles/paths that the breadcrumb will render as invalid:

  1. The menu item title does not match the page title 
  2. There is a custom path alias for the page that does not match or was not generated by the page title
  3. There are redirects (generated from editing of page titles if set to automatic) set up for the page that causes the path alias to be mismatched

Note: Non alphanumeric characters and symbols, as well as letter casing can affect how a path is rendered and may cause a mismatch.

The breadcrumb relies on proper configuration of pages and menu items. Please ensure to follow best practice when creating pages and menu items.


  • See Basic Page for more information on how to manage your pages.
  • See Menus for more information on how to manage your menu.