When I select the first page of a book the menu breadcrumb is correct but as soon as I chose a another page the menu breadcrumb only shows the Home link and the book breadcrumb. How do I retain the the whole menu breadcrumb and not just the Book breadcrumb for all pages of a book?


xurizaemon’s picture

Status: Active » Needs work

Please take a look at
* #269962: Page does not reflect the structure if it is part of a Book
* #352294: Book outline overrides menu breadcrumb (marked dupe but has lots of discussion)
* #595282: Menu weights (which jweowu says resolved the above)

Menu Breadcrumb doesn't currently descend from your main site menu into the book menu. This is a good suggestion, but I'm not sure how we'd implement it to play nicely with Book module. So your options would appear to be -

either ... Do some extra maintenance on the book pages to ensure they appear in the parent menu structure, and disable the book menus in Menu Breadcrumb settings.

or ... Contribute code which takes care of the process of building a complete breadcrumb from the book page back to the site root.

Happy to consider suggestions / patches. This sounds like a fairly specific use case, and you'll probably need to implement it if you want it in this module.

Sborsody’s picture

Menu weights doesn't work exactly (wow, you're lucky that your first page has a correct breadcrumb!). For example, I have primary-links weighted less than the /book-toc/ pattern. Menu_breadcrumb correctly picks primary-links as the first enabled menu to use as the active menu_breadcrumb and sets the breadcrumb accordingly, but then the book.module just overrides it and sets the active trail to whatever book.module wants. I had this problem too with taxonomy pages and overrode taxonomy.module using a call to menu_get_active_breadcrumb() in theme_breadcrumb, but taxonomy.module uses drupal_set_breadcrumb instead of menu_set_active_menu_name(). I'm convinced that this issue is a problem with Drupal core, not menu_breadcrumb, and thus cannot be solved easily in menu_breadcrumb. (See #150854: fix breadcrumbs arbitration bug .)

But what I *really* want is to have the trails merged so that the breadcrumb looks like Home > Book TOC (in primary-links) > Book Page (from book.module). I think the best place to do this at the moment is at the theming layer.

Walter.Kuhn’s picture

Interested in that solution too.