How Breadcrumbs are Generated
Breadcrumbs are generated based on the URL alias of the page being displayed. When generating the breadcrumb for a page that's being viewed, each "level" of the path is checked to see if a page exists with that path. If so, it's added to the breadcrumb trail.
This is best explained by example.
Let's say you have 3 pages on your site:
- Page A with path /page-a
- Page B with path /page-a/page-b
- Page C with path /page-a/page-b/page-c
Someone visits Page C, which has path /page-a/page-b/page-c. When generating the breadcrumb trail, the system starts from the first level of the path and moves up, performing the following checks:
- Does a page on your site exist with The user-friendly path for a content item or taxonomy term that replaces the system path. For example, /my-page can be an alias for /node/123.
/page-a? If so, it's added to the breadcrumb trail.
- Does a page on your site exist with URL alias /page-a/page-b? If so, it's added to the breadcrumb trail.
- Does a page on your site exist with URL alias /page-a/page-b/page-c? If so, it's added to the breadcrumb trail.
The label used for each page in the breadcrumb trail corresponds with the menu link title for that page. If the page is not in the menu, then the title of the page is used instead.
Due to this behavior, you must remember that if you change the URL alias of your "parent" pages to something else, you need to manually update the URL alias of the child pages as well. If you don't the breadcrumb trail for the child pages will not include the parent page in the path and they will appear broken. Visit the page on URL Aliases to learn how to bulk regenerate paths.