I'm requesting to be able to completely disable the breadcrumbs, and to have a block with breadcrumbs.
the nicest way i can see to do that, is to make a module for it.

posting it against menu, as that seems to be the best place.

Comments

sun’s picture

Holy cow. What an awesome idea!

Should be fairly easy -- still possible for D7?

alexanderpas’s picture

Title: Provide breadcrumbs as module with block. (similar to path, menu and search.) » Provide breadcrumbs as seperate module with block. (similar to path, menu and search.)
Version: 7.x-dev » 8.x-dev

I guess not, since we're already in code slush. (4 months before the first reply... I love Open Source ;) )

Edgar Saumell’s picture

subscribing

stephthegeek’s picture

Just had the same thought and went looking for an issue. Thumbs up for this, and it's in line with the way other page content has been going in Drupal.

dman’s picture

FWIW, I have just done something similar now in a sandbox module for D6. Mostly trivial and easy.
http://drupalcode.org/viewvc/drupal/contributions/sandbox/dman/breadcrum...

You can get it by going
cvs co -d :pserver:anonymous@cvs.drupal.org:/cvs/drupal-contrib -d breadcrumb_block contributions/sandbox/dman/breadcrumb_block

... not sure if it's worth a stand-alone project yet. Maybe.

Options on the block config page include:

  • Show 'Home' or not.
  • Show current page title or not
  • Remove breadcrumbs from their normal position in page.tpl.php (dodgy code)

... Now I can place breadcrumbs in the $header from the UI :-)

Until now this has been regarded as a theme thing, but it can also be done through a module, and I prefer managing it like this. Some code taken (with respect) from Zen theme which provides some of this functionality also.

Just making a note here as it's the search result I found when looking for previous solutions.

jbrown’s picture

This is awesome. We need a proper breadcrumbs api in D8.

dman’s picture

Remove breadcrumbs from their normal position in page.tpl.php (dodgy code)

Less dodgy now, I found I can use hook_preprocess_page() to nullify the default breadcrumb rendering.
@me happy now.

Thinking this really is worth a small project of its own. For incubation if nothing else.

klonos’s picture

sun’s picture

effulgentsia’s picture

I just today had to add this code to a D6 site:

function MYCUSTOMTHEME_breadcrumb($breadcrumb) {
  if ($breadcrumb !== array(l(t('Home'), NULL))) {
    return zen_breadcrumb($breadcrumb);
  }
}

and this code to a D7 site:

function MYCUSTOMMODULE_preprocess_breadcrumb(&$variables) {
  if ($variables['breadcrumb'] === array(l(t('Home'), NULL))) {
    $variables['breadcrumb'] = NULL;
  }
}

in order to not display a breadcrumb when the only link in it is "Home", so for this and many other reasons, +1 to this issue for D8, with some config options as per #5.

Note also some of the UI discussion in #897768: Breadcrumb can show only one trail item, making it look like an action. Would be good to collate some more UI research on what would make for sensible defaults.

effulgentsia’s picture

#10 was x-post with #9. Awesome! Glad we have a D7 contrib project for pushing this along!

sun’s picture

You will be able to simplify and speed up your code after #907690: Breadcrumbs don't work for dynamic paths & local tasks #2 landed. It introduces hook_menu_breadcrumb_alter(). :)

Jeff Burnz’s picture

Oh dear lord let this happen - subscribe...

Scott J’s picture

If anyone needs a breadcrumb block right now, Blockify module will do it for you.

xjm’s picture

Crell’s picture

Issue summary: View changes
Status: Active » Fixed

Breadcrumbs are now blocks. Turn the block off if you want. :-)

Status: Fixed » Closed (fixed)

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