- I use the Book module to create books with chapters.
- When I use the default twig template
node.html.twig
to display a book chapter, a section titled "Book traversal links" is included, with links to the previous chapter, the next chapter, and to the book. The debugger says these links come from thebook-navigation.html.twig
template. - Instead of the default template, I'm using a custom twig template
node--chapter.html.twig
to display chapters.
QUESTION:
How can I get the same book traversal links onto my custom page?
NOTES:
- I checked for a block containing the book traversal links that I could just insert in my twig template, but I don't see one.
- I have checked the $variables array in the twig template to see if maybe a list of the chapter's siblings is already there, but don't see one.
- I'm already using HOOK_preprocess_node(&$variables) to find the book parent book's id, so I can use it to find the chapter's siblings, if that's the way to go.