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.
Thhe way the "Core" breadcrumb handler is programmed, there's no way you can use drupal_set_breadcrumb()
(in hook_init()
, for example) to alter the breadcrumbs on the page.
This breaks the many breadcrumb altering modules out there as well as the context module's breadcrumb rules.
I suggest the addition of a new BreadCrumb handler called "Ignore" in addition to "Core" and "Hidden" -- this handler would do nothing at all when $breadcrumb_display->buildBreadcrumb($term)
is called, and other modules that call drupal_set_breadcrumb() could then get the job done. Thoughts?
Comment | File | Size | Author |
---|---|---|---|
#8 | taxonomy_display-add_ignore_breadcrumb_plugin-1798196-8.patch | 2.42 KB | codycraven |
#1 | taxonomy_display-added_ignore_breadcrumb_handler-1798196-1.patch | 2.32 KB | tmsimont |
Comments
Comment #1
tmsimont CreditAttribution: tmsimont commentedpatch attached
Comment #2
codycraven CreditAttribution: codycraven commentedSeems like we could make the hidden handler do this just by removing
drupal_set_breadcrumb('');
.How does that sound to you?
Comment #3
tmsimont CreditAttribution: tmsimont commentedSure -- that's basically what the added "Ignore" handler I put up does.
The reason i suggested an "Ignore" handler is because the "Hidden" handler advertises itself to hide the breadcrumbs. If it doesn't call
drupal_set_breadcrumb('');
it will not hide the, but ignore them.I'm not sure if that will be a negative effect on some users.
Comment #4
codycraven CreditAttribution: codycraven commentedGood point, how about instead of Ignore we use the name Defer then? As in defer to other modules... or maybe have it labeled as "Defer to other modules", to be explicitly clear.
Comment #5
lotyrin CreditAttribution: lotyrin commentedI'd prefer Ignore to Defer, if we don't like Ignore what about "None". Whatever's picked, if the description gets set to something explanatory, that seems like it should be sufficient.
Comment #6
codycraven CreditAttribution: codycraven commentedSounds good, I'd like to change the description for ignore (in the patch) from:
To:
If that is clear enough I'll commit and push the issue, if not please provide further feedback.
Comment #7
lotyrin CreditAttribution: lotyrin commentedFurther:
"Taxonomy display will not set a breadcrumb, allowing other modules to do so."
Comment #8
codycraven CreditAttribution: codycraven commentedThe patch below has been committed and pushed to 7.x-1.x.
Comment #9
codycraven CreditAttribution: codycraven commentedComment #11
firestonej CreditAttribution: firestonej commentedNot to resurrect this issue, but...
Does this functionality make sense? Even when custom term display isn't being used for a given taxonomy, set_breadcrumb still fails site-wide for that taxonomy. Seems to me like Ignore should be the default functionality. Turning taxonomy display on for every taxonomy that I want to have breadcrumbs just so I can use all default settings but set Breadcrumb to "Ignore" seems completely arbitrary to me.
Not to mention, it took hours and hours to find, because it's not documented anywhere that this module utterly overrides all other term breadcrumb-setting modules.
Comment #12
tmsimont CreditAttribution: tmsimont commentedThe functionality developed for this issue addresses your exact need. The problem your having is based on the default behavior of the module. I would recommend opening a new issue. Make it a feature request, and ask the module maintainers to make the functionality developed here the default behavior.