Account created on 22 January 2019, over 5 years ago
#

Recent comments

I just put together a new patch that adds the dynamic option for the module's RC2 version.

I also had some issues using the in_active_trail variable within my template. I noticed it was being overwritten in the buildItems() function. So, I also made some adjustments to ensure the in_active_trail variable was set correctly.

It looks like the book_menu_default option wasn't really needed. Deselecting Always expand the menu provides the desired result.

The patch still needs to be tested.

Hello! Thanks for your questions!

1.) The reason the Dynamic option was added is that we needed a way to only show the menu for the current book. For example, our website has three books (book1, book2, and book3) with their own menu structure. When I navigate to book1, I only need to see the menu for book1. When the block_mode was selected with book pages, the menu for book1, book2, and book3 was present on book1.

Also, since we use layout builder for our content types, it was nice to add the block once and have the block choose the current $bid instead of manually selecting the book menu to display.

2.) I believe I added this so the menu would retrieve nested data under the selected book page. For example, Book1 has three book pages nested: BookPageTutorial1, BookPageTutorial2, and BookPageTutorial3. All the book pages have three menu items nested as well. When on BookPageTutorial1, update the menu to display the three menu items nested.

Structure on BookPageTutorial1:

Book1
BookPageTutorial1
Tutorial1
Tutorial2
Tutorial3
BookPageTutorial2
BookPageTutorial3

Structure on BookPageTutorial2:

Book1
BookPageTutorial1
BookPageTutorial2
Tutorial1
Tutorial2
Tutorial3
BookPageTutorial3

I am not sure if adding the return parent::build(); would give the desired result, but it might. Please let me know if you have any other questions!

Production build 0.69.0 2024