By petrd on
Hi folks,
any idea how to customize breadcrumb trails for page views? They show just "Home" by default, which is not what I want.
I'm using the taxonomy_breadcrumb module to generate breadcrumbs for nodes, but this doesn't work for views.
For example, when displaying a node containing an announcement, the breadcrumb is correctly displayed as:
Home > Council > Announcements
but when listing all announcements (using a page view), I get only:
Home
as breadcrumb instead of
Home > Council
Thanks for any help,
Petr
Comments
yep, by the time i factor in
yep, by the time i factor in contributed modules, custom IA and paths, etc, tweaking breadcrumbs seems unavoidable (if you want to use them at all). but i'd hack away at the theme_breadcrumb function (i.e. override it in your theme's template.php), rather than adding another contrib module. this seems like a theming issue to me, and i'd rather not add another dependency if possible. my .02, anyway!
That's what I feared, being
That's what I feared, being not really a coder. Can you maybe advice a bit more how to do this? I'd like to change breadcrumbs only for views. For nodes it's perfectly ok with the taxonomy_breadcrumb module.
Thanks a lot,
Petr
for background, check out
for background, check out the Drupal 5 Theme Developer's Guide and the page on Using Theme Override Functions.
i'm not sure if it's the best way, or if there's a technique out there that's specific to Views, but what i do is analyze the current path and customize breadcrumbs from that. so in my theme's template.php file, i'll override Drupal's default theme_breadcrumbs function with a function like this:
This worked for me...
Thank you so much arh1, this got me on the right track. I switched the order of things and hand coded the path, to make it 1. work for my situation, and 2. not execute all the time: