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.
I get a small number of support requests in the Easy Breadcrumb queue related to Bootstraps Breadcrumbs causing trouble for folks. Can we add a checkbox to disable the breadcrumbs for Bootstrap so that Bootstrap can work with other modules that extend breadcrumbs?
One of the support threads can be found here: https://www.drupal.org/node/2908915.
~G
Comment | File | Size | Author |
---|---|---|---|
#7 | Screen Shot 2017-09-30 at 4.49.00 PM.png | 92.93 KB | Greg Boggs |
Comments
Comment #2
markhalliwellThese aren't "Drupal Bootstrap" breadcrumbs, they're just normal breadcrumbs with only a few enhancements (to alter the items in the breadcrumb array, e.g. appending/prepending/removing certain items).
Ultimately, these items are just Render Arrays or MarkupInterface objects that are rendered into the proper Bootstrap markup.
The "enhancements" provided by this base theme can easily be disabled by overriding the plugin in a sub-theme and not calling the parent methods. Obviously if one wishes to use a module such as Easy Breadcrumb, then they need to adjust their sub-theme accordingly.
Not every module/theme is going to work "out-of-the-box" with every other single module/theme.
The responsibility lies to the developer of the site to determine which modules/themes are compatible and to fix or provide custom code (as needed) when competing functionality like this is desired.
This is called site-building.
---
Create the following file in your sub-theme and replace all instances of
THEMENAME
with the lowercase machine name of your sub-theme:
./THEMENAME/src/Plugin/Preprocess/Breadcrumb.php
Comment #3
Greg BoggsThanks for the template Mark! That's just what I needed. Super good. I'll go ahead and include an option in easy breadcrumb for folks who aren't comfortable with programming their theme.
~G
Comment #4
markhalliwellThis is a preprocess hook (as a Bootstrap base theme based OO plugin), not a template.
Even if the base theme were to search module namespaces, it would immediately be overridden by the base theme due to how the theme system works.
Theme preprocess functions are always executed after module preprocess functions.
Historically, a module could implement a theme registry alter so it could modify preprocess functions so theirs could run after. However, this has always been considered bad practice (modules shouldn't be in the theming business).
Given that this base theme's implementation is an OO based plugin (discovered by the base theme itself http://cgit.drupalcode.org/bootstrap/tree/src/Plugin/PluginManager.php#n58), only sub-themes can override the base theme's implementation.
Simply put: this cannot be implemented in a module, only a sub-theme.
Comment #5
markhalliwellIt's also worth noting the following, from #2912611: how to completely disable bootstrap breadcrumb?, which implies there's actually nothing wrong with the module nor this project:
Comment #6
Greg BoggsThanks for the additional details Mark. I appreciate it. Thanks for rocking it. I'll do some testing and see if I can write some documentation for the new folks.
~G
Comment #7
Greg BoggsAs long as folks don't use, "Show current page title at end" with Easy Breadcrumb also adding the current page title, then the two play nicely together. Screen shot attached.
Comment #8
tonytheferg CreditAttribution: tonytheferg commented@ Greg Boggs, I am unable to find the check boxes in the easy breadcrumbs UI from your screenshot?