Download & Extend

Provide breadcrumbs as seperate module with block. (similar to path, menu and search.)

Project:Drupal core
Version:8.x-dev
Component:menu system
Category:feature request
Priority:normal
Assigned:Unassigned
Status:active

Issue Summary

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

#1

Holy cow. What an awesome idea!

Should be fairly easy -- still possible for D7?

#2

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 ;) )

#3

subscribing

#4

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.

#5

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.

#6

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

#7

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.

#8

#9

#10

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.

#11

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

#12

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(). :)

#13

Oh dear lord let this happen - subscribe...

#14

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

#15

nobody click here