add ability to have several breadcrumbs on the page.
e.g. One breadcrumb is set using Drupal: Home -> book-parent -> book-child
And the second is set using taxonomy_menu module: Home -> book-page-category -> book-page-subcategory.

Admins can allow/disallow several breadcrumbs, and the last decision does to template's theme_breadcrumb().

CommentFileSizeAuthor
#5 bc-weight-73834-5.patch1.5 KBpwolanin
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

LAsan’s picture

Version: x.y.z » 7.x-dev

Feature request, moving to cvs.

beginner’s picture

I just posted about this on the dev list.

beginner’s picture

pwolanin’s picture

Well, the timing problem certainly is a problematic bug - seems like a simple solution might be (even for D6) to take several alternate BC arrays with each one getting a weight.

something like this:

function drupal_set_breadcrumb($breadcrumb = NULL, $weight = 0) {
  static $stored_breadcrumb = array();

  if (!is_null($breadcrumb)) {
    $stored_breadcrumb[$weight] = $breadcrumb;
    ksort($stored_breadcrumb, SORT_NUMERIC);
  }
  return current($stored_breadcrumb);
}
pwolanin’s picture

Category: feature » bug
Status: Active » Needs review
FileSize
1.5 KB

here's a patch that might also be suitable for 6.x as a bug fix.

This is a minimal change that just allows a developer to be sure that their BC will have priority over one being set (for example) by a core module.

beginner’s picture

Category: bug » feature
Status: Needs review » Active

I agree it's a bug. See my follow up on the other issue: #150854: fix breadcrumbs arbitration bug
I prefer the patch there, because it paves the way to a much for powerful hook_breadcrumbs() with $op, $path, $args, etc.

With that new hook_breadcrumbs(), themes would be able to get an array of breadcrumbs and display more than one set of breadcrumbs, which is the current feature request.

pwolanin’s picture

Status: Active » Needs review
moshe weitzman’s picture

This can't be a bug IMO. The system is working as designed. Adding a second breadcrumb is a new feature. Seems clear cut to me.

pwolanin’s picture

Title: several breadcrumbs » provide a window for setting the page breadcrumbs
Category: feature » bug

@moshe - changing the title to reflect what the patch does.

Basically - if the breadcrumb is set in the page callback, I think there is pretty much no way to override it unless you hack the theme layer. That's what I'm identifying as the bug. The change proposed should be a backward-compatible and opens the window by adding the weight parameter (we could call it $priority or something else if you like).

beginner’s picture

Title: provide a window for setting the page breadcrumbs » several breadcrumbs
Category: bug » feature
Status: Needs review » Active

pwolanin: you are hijacking this issue. See the other issue for the bug you are trying to fix.
I mentioned your patch in the other issue.

Having several breadcrumbs is a bona fide feature request.

pwolanin’s picture

@beginner - sorry - I missed that link - didn't mean to hijack.

mdupont’s picture

Version: 7.x-dev » 8.x-dev
kika’s picture

Was proposing it back at 2002. +1

sun’s picture

Title: several breadcrumbs » Allow multiple breadcrumbs on a page
Issue tags: +Blocks-Layouts

Better title.

FWIW, I once started the http://drupal.org/project/breadcrumb module with a seemingly identical goal; multiple breadcrumbs, and breadcrumbs as blocks. Given D8, I think this ties deeply into Blocks and Layouts.

Crell’s picture

Issue summary: View changes
Status: Active » Fixed

Breadcrumbs are now blocks. This is done. :-)

Status: Fixed » Closed (fixed)

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