- I use the Book module to create books with chapters.
- When I use the default twig template
node.html.twigto 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 the
- Instead of the default template, I'm using a custom twig template
node--chapter.html.twigto display chapters.
How can I get the same book traversal links onto my custom page?
- 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.