Allow administrators to disable breadcrumbs for all paths that aren't affected by patch breadcrumbs, effectively disabling breadcrumbs from other modules, including drupal core.

It should be a setting turned off by default so as not to affect existing sites.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Snehal Brahmbhatt’s picture

Hi rooby,

Reviewed your requirement and you can use this module for your purpose:
https://www.drupal.org/project/disable_breadcrumbs

Let me know if you face any query/concern regarding this.

Thanks,

Snehal Brahmbhatt’s picture

Assigned: Unassigned » Snehal Brahmbhatt
Issue tags: +breadcrumbs, +drupal 7
kalabro’s picture

Assigned: Snehal Brahmbhatt » Unassigned
Category: Support request » Feature request
Issue tags: -breadcrumbs, -drupal 7

Hey @rooby! Thanks for your request!
At the moment PB can't disable another's breadcrumbs (from core or other contribs). It designed not to break other stuff. However patches are welcome :)

Thanks for the link @snehal.brahmbhatt! I haven't seen this module.

Marking as a feature request. Removing unnecessary tags.

kalabro’s picture

Title: How can I disable breadcrumbs on all pages except ones that match a path breadcrumb configuration? » Allow to disable breadcrumbs from other modules
rooby’s picture

Assigned: Unassigned » rooby

Thanks for the quick replies.

After a quick look at the code it actually shouldn't be that hard to implement.

I'm hoping I could get away with just adding a setting that controls some logic in the path_breadcrumbs_set_breadcrumb() function to null the breadcrumb for pages that return false from path_breadcrumbs_load_variant().

I need this for a current project so I'll see if it works later today and make a patch if it succeeds.

rooby’s picture

Title: Allow to disable breadcrumbs from other modules » Allow admins to disable breadcrumbs from other modules
Assigned: rooby » Unassigned
Issue summary: View changes
Status: Active » Needs review
FileSize
1.94 KB

Here's a patch that works from my initial tests but I will do some more thorough testing soon.

rooby’s picture

Here's an updated version of the patch that also properly handles error pages when path breadcrumbs are disabled on error pages.
With the old version of the patch breadcrumbs would still show on error pages in this case.

rooby’s picture

Oops, crummy patch name :)

todea’s picture

I made a quick edit to this patch so that it doesn't knock out breadcrumbs for admin themed pages.

global $theme;
  // Unset breadcrumbs if there are no path breadcrumbs for this page.
  if ($path_breadcrumbs_data === FALSE && variable_get('path_breadcrumbs_disable_other_breadcrumbs', FALSE) && $theme != variable_get('admin_theme', 'adminimal')  ) {
    drupal_set_breadcrumb(array());
  }