I needed to set a custom breadcrumb for every view I created.

I came up with the following code, put this in the argument handling code section of the view:

$breadcrumb[] = l('Home', null);
$breadcrumb[] .= l('News', 'news');
$breadcrumb[] .= l('Politics', 'politics');
drupal_set_breadcrumb($breadcrumb);

In this case, the breadcrumb will look like this:

Home -> News -> Politics

Maybe there's a way to customize this code to use a full vocabulary - term path.

Thanks to gbear for the idea.

Any better ideas are welcome...

Comments

doc2@drupalfr.org’s picture

For my panels (v.5.x-1.x), I simply put this code into the body of any custom-defined content of the panel and set this body's "Input format" to "PHP code". And it's done!

Anonymous’s picture

What is the code for Drupal 6?

lelizondo’s picture

For drupal 6 go to the original discussion http://drupal.org/node/215475

Luis

miles28’s picture

It's cool, but why doesn't it print when browsing the site as user. I can only see these kind of breadcrumbs for views if I browse logged out.

lelizondo’s picture

I don't have this problem and without more info I don't know how to replicate it. Don't see a reason why this wouldn't work for logged users.

Luis

Luis

pelicani’s picture

This solution does NOT address the breadcrumb problems when dealing with a view with arguments.
The view module will continue to append its own breadcrumb to this.
continuing to find a solutions...

peace,
michael

Web Developer : RockRiverStar.com : Philadelphia, PA

Technical Architect : Philadelphia, PA

adamo’s picture

It seems to work for me. Make sure your custom PHP pane appears after your view pane in your panel.

pianomansam’s picture

For this to work in Drupal 5.17, I had to put it in the header and set the Input Filter to PHP.

steveoliver’s picture

This seems to work alright for me.

--
Steve
Circatree

rakesh.gectcr’s picture

---
Kind regards,

Thank you,
Rakesh James