开发者

2 breadcrumbs for 2 menus in Drupal

I'm using 2 different menus in 2 different blocks. They are enabled / disabled d开发者_StackOverflowepending 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


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.


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
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜