views:

29

answers:

2

hi,

I'm using 2 different menus in 2 different blocks. They are enabled / disabled depending on the the pages users arevisiting.

Now, I have an issue with the breadcrumbs: they only work with the main menu and not the second one.

I need to automatically have the breadcrumbs the other menu as well.

thanks

A: 

Drupal's menu system sets only one active menu at a time: if you're trying to have two breadcrumbs at the same time on the same page, you're going to need to use menu_set_active_menu_name() to do some juggling back and forth.

However, if you're just trying to have one show up, consider using the Menu Breadcrumb module, which automatically sets the active menu based on the page. You also have the ability to set menu priority for pages that exist in more than one menu.

Mark Trapp
I'm actually using "menu breadcrumbs", and I've checked both menus in the settings. But I can only give priority to one of the two menus. Some pages belong to both menus (I have 2 languages and each menu displays according to the selected language). In conclusion, if the pages are translated in two languages and belong to both menus, the first menu is always picked up for breadcrumbs, even if I'm using the second one.
Patrick
That's Drupal core's behavior: only one active menu at a time. If you're just trying to localize the the same content, setting up two different menus isn't the way to go: use core's Content Translation and Locale modules to provide language-specific versions of the same content and IA.
Mark Trapp
The point is that my english menu has completely different structure of the italian one. But many pages have both english and italian version.
Patrick
Is this a valid point ? I mean, do you know how to solve it ?
Patrick
A: 

This question is not strictly programming related, however:

Drupal breadcrumbs follow the menu-items as they are enabled. Regardless of whether the menu-items are visible, and regardless of what menu(containers) hold the menu. Items that are not in the menu (such as nodes!) will not have a breadcrumb.

That said, there is an exception, modules can override the breadcrumb with drupal_set_breadcrumb(), if they do so, the last one to set the breadcrumb gets to set the breadcrumb. E.g. taxonomy module sets the breadcrumb on taxonomy-pages.

  1. You could set the breadcrumbs hardcoded in a module.
  2. You should investigate why breadcrumbs don't follow your menu's in this case.
  3. You could investigate modules that allow tweaking the breadcrumb behaviour, such as hansel
berkes

related questions