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.
Problem
- You might need to display an unlinked current page title on every breadcrumbs.
- You might want to preserve the default breadcrumb generation on some pages.
- When using path breadcrumbs, not all pages on your site might have a variant and you might not want to create variant for some automated pages.
Solution
Introduce a configurable setting that force the appending of the current page title on page not currently being managed by path_breadcrumbs (no variant hit).
Comment | File | Size | Author |
---|---|---|---|
#9 | append_page_title_unmanaged-2768899-9.patch | 2.43 KB | natew |
#6 | append_page_title_unmanaged-2768899-6.patch | 2.24 KB | ptsimard |
#2 | append_page_title_unmanaged-2768899-2.patch | 2.04 KB | ptsimard |
Comments
Comment #2
ptsimard CreditAttribution: ptsimard commentedComment #3
sylus CreditAttribution: sylus commentedLooks good to me and like that it is opt-in behavior.
Committed and attributed, thanks!
Comment #5
ptsimard CreditAttribution: ptsimard commented@sylus, it seems you didn't commit this patch after all.
Here is a new patch with an improvement:
It now makes sure the last breadcrumb item is a link before appending a non-link (prevents appending a non-link to a non-link).
I noticed it when a page was being managed by panels_breadcrumbs module instead of path_breadcrumb. I didn't want to introduce a dependency check on panels_breadcrumbs so I think this solution works well for this (and potentially other) edge case.
Comment #6
ptsimard CreditAttribution: ptsimard commentedTotally had a logic error in patch 5, here is #6
Comment #7
sylus CreditAttribution: sylus commentedAh sorry not sure what happened, this time it is now committed. :)
https://github.com/wet-boew-wem/wetkit-breadcrumbs/commit/aad181bf8e096b...
Committed and attributed.
Comment #9
natew CreditAttribution: natew commentedThanks for the patch! I needed this in a recent upgrade from 1.x to 4.x that I was doing for a client. They are using a postgres db (not sure if this is related), but sometimes the titles don't show up, particularly in french, and if the breadcrumb trail is from the menu. I modified the code a bit to use menu_get_active_title if nothing is returned from drupal_get_title.