Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Is there a way to make the Node->Book Navigation element show the entire book hierarchy instead of the children of the current node? I've trued overriding theme_preprocess_book_navigation and the template file with no success.
If I add the Book Navigation Block it works like this, but I can't use the block in a Panel content area.
I'm also looking to display the hierarchy in a less formatted way (I don't want the collapsed bits). Any tips?
Comment | File | Size | Author |
---|---|---|---|
#8 | panesourceconfig.png | 16.86 KB | Letharion |
#5 | context-tab.png | 6.18 KB | merlinofchaos |
Comments
Comment #1
merlinofchaos CreditAttribution: merlinofchaos commentedon the 'Contexts' tab, add the relationship: "Book Parent". Choose the 'top' option.
Then select that in the navigation pane's settings instead of the current node.
Comment #2
balancestuff CreditAttribution: balancestuff commentedThanks, I will try that.
Can you point me to the Context tab?
Update: Is the Context tab only available for Panel Pages, not Panel Nodes? I see it there, but no "Book Parent" option to add.
Comment #3
balancestuff CreditAttribution: balancestuff commentedAs an additional update, I am experimenting with overriding the Node Template for the Panels content type. This may be what is required.
It looks like with the Context in the Node Template I can use the context in panels added to the Node Template layout, but not to content of that kind.
This doesn't quite work, although it may be something I am doing wrong. I can set up the Context, but it's only visible to elements in the overall 'Node Template' not the actual Nodes of the Panel content type made from it... Which doesn't work with my desired layout.
Comment #4
balancestuff CreditAttribution: balancestuff commentedComment #5
merlinofchaos CreditAttribution: merlinofchaos commentedComment #6
merlinofchaos CreditAttribution: merlinofchaos commentedNote that I make the assumption that you already have a node context of some sort available. The 'book parent' will be in Relationships. If overriding the node template, it should just appear there to be added.
Comment #7
balancestuff CreditAttribution: balancestuff commentedI think I'm getting closer, but I'm still unable to select the new Relationship in my Panel page content.
First question: In the 'relationship' config screen, should 'Node' be set to 'Node being viewed'?
Does my question make sense? As I understand it, there's a Node Template which can be displayed as a Panel. The Node is then displayed as Node Content in the selected Panel region, and the Node Content may also be a Panel. I'm trying to get the Book Navigation in a Node Content item to display the full book hierarchy.
Finally, is there a good doc you can point me too so you don't have to keep dealing with my questions. :)
Comment #8
Letharion CreditAttribution: Letharion commentedYour question makes sense. In the relationship config screen, you should pick the content you want to be the "Source" of the relationship. In the vast majority of cases you have only a single option, being "Node being viewed", as you suggest.
After that, when you add new content, such as "Book Navigation" as you want, to a page, you can however pick one of two sources, since in addition to "Node being viewed", we have now added "Book parent" as well. See attached image. That should be all.
No, the docs are unfortunately not very good, still, work is in progress, but with everyone being a volunteer, it takes time.
Comment #9
Letharion CreditAttribution: Letharion commentedChanging to support request since the feature is already available.
Comment #11
jwilson3Perhaps technically speaking, #1 does solve the issue that the Book navigation pane only shows the current level, however, I question the actual utility of the solution to show the top level using a context relationship joined on the book parent. If you select 'Top level book' for the Relationship, as Earl suggested in #1, the Book navigation pane show the book's Level 1 links but it doesn't *expand* the book hierarchy down showing an active-trail if you are down inside a L2 or L3 level book page.
There is a parallel discussion about replicating the normal Book navigation block on on #640226: Adding Book Navigation Block to panels and mini-panels, so I wont reopen... just linking and thinking.
Comment #12
balancestuff CreditAttribution: balancestuff commentedI ended up adding a "Menu" panel item to each page that has the book navigation in it. Worked great, with the major concern that I don't have to update a couple dozen pages if the menu structure changes resolved.
Comment #13
Divya Rathanlal CreditAttribution: Divya Rathanlal commentedDiscussions #5 and #8 greatly helped me. Thanks!
Comment #14
jelo CreditAttribution: jelo commentedI ended up using Menu Block module which offered some other advantages and fixed my problems with book navigation in panels:
https://drupal.org/project/menu_block
J.