How to define a custom breadcrumb for a view?
Last modified: October 11, 2008 - 03:56
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...

Custom breadcrumbs for panels
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!
What is the code for Drupal
What is the code for Drupal 6?
For drupal 6 go to the
For drupal 6 go to the original discussion http://drupal.org/node/215475
It's cool, but why doesn't
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.
I don't have this problem
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
Views with Arguments...
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
It seems to work for me.
It seems to work for me. Make sure your custom PHP pane appears after your view pane in your panel.
Put the code in the View Header
For this to work in Drupal 5.17, I had to put it in the header and set the Input Filter to PHP.
This seems to work alright
This seems to work alright for me.
--
Steve
Circatree