Spent today scratching my head trying to determine why the built-in D7 "Seven" theme was printing breadcrumb paths that matched my menu nesting/hierarchy, but the Zen theme and my sub-theme did not.

The issue came up when I added a taxonomy term link to the site's primary navigation, nested under another node menu item, like this:


Home (node)
News (node)
- Top Stories (node)
Company (regular 'Basic Page' node)
- Careers (taxonomy term path page for 'careers')
- - Contractor (node tagged with 'careers' term)
- - Directory (another node tagged with 'careers')

Whenever I visited the 'Careers' page the breadcrumbs only showed 'Home' instead of 'Home > Company.' Same thing when I viewed the 'Contractor' page.

However, when I viewed the 'Top Stories' page, the breadcrumb correctly output 'Home > News'

When I switched themes to 'Seven' -- whose template.php did not have any theme_breadcrumb() overriding hooks -- and revisited the 'Contractor' page, the breadcrumbs properly spit out 'Home > Company > Careers.'

I'm not a Drupal API expert, but know enough to get into trouble. So I copied the zen_breadcrumb() function from Zen core's theme and pasted it into my sub-theme, and just changed one line in that function:

// $breadcrumb = $variables['breadcrumb']; // (Original)
$breadcrumb = menu_get_active_breadcrumb(); // Seems to force expected, active-trail based breadcrumbs

That override seems to make everything work as expected (based on my menu configuration / active trail), but I'm still not sure why.

I can provide more details if anyone likes, but I think the issue, if this isn't by design, is related to order in which Zen sets/resets the 'breadcrumb' variable, since the other themes seem to work as expected natively. Amateur guess though.

Comments

amaisano’s picture

Issue summary: View changes
johnalbin’s picture

Version: 7.x-5.5 » 7.x-5.x-dev
Status: Active » Closed (won't fix)

If Zen is being given the wrong set of breadcrumbs, that's not Zen's fault. there's either some buggy contrib module on your site or a bug in core.