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?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

tmsimont’s picture

Status: Active » Needs review
FileSize
2.32 KB

patch attached

codycraven’s picture

Seems like we could make the hidden handler do this just by removing drupal_set_breadcrumb('');.

How does that sound to you?

tmsimont’s picture

Sure -- 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.

codycraven’s picture

Good 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.

lotyrin’s picture

Status: Needs review » Reviewed & tested by the community

I'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.

codycraven’s picture

Status: Reviewed & tested by the community » Needs review

Sounds good, I'd like to change the description for ignore (in the patch) from:

The breadcrumb trail will be ignored. Some other module should write the breadcrumb path.

To:

The taxonomy term will not populate a breadcrumb, allowing other modules to do so.

If that is clear enough I'll commit and push the issue, if not please provide further feedback.

lotyrin’s picture

Status: Needs review » Reviewed & tested by the community

Further:

"Taxonomy display will not set a breadcrumb, allowing other modules to do so."

codycraven’s picture

The patch below has been committed and pushed to 7.x-1.x.

codycraven’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

firestonej’s picture

Not 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.

tmsimont’s picture

The 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.