book-navigation.html.twig in Drupal 10
Same filename in this branch
- 10 core/modules/book/templates/book-navigation.html.twig
- 10 core/themes/starterkit_theme/templates/navigation/book-navigation.html.twig
- 10 core/themes/classy/templates/navigation/book-navigation.html.twig
- 10 core/themes/olivero/templates/navigation/book-navigation.html.twig
- 10 core/themes/stable9/templates/navigation/book-navigation.html.twig
- 10 core/themes/stable/templates/navigation/book-navigation.html.twig
- 10 core/themes/claro/templates/classy/navigation/book-navigation.html.twig
- 10 core/themes/seven/templates/classy/navigation/book-navigation.html.twig
- 10 core/themes/bartik/templates/classy/navigation/book-navigation.html.twig
- 10 core/profiles/demo_umami/themes/umami/templates/classy/navigation/book-navigation.html.twig
Same filename and directory in other branches
Theme override to navigate books.
Presented under nodes that are a part of book outlines.
Available variables:
- tree: The immediate children of the current node rendered as an unordered list.
- current_depth: Depth of the current node within the book outline. Provided for context.
- prev_url: URL to the previous node.
- prev_title: Title of the previous node.
- parent_url: URL to the parent node.
- parent_title: Title of the parent node. Not printed by default. Provided as an option.
- next_url: URL to the next node.
- next_title: Title of the next node.
- has_links: Flags TRUE whenever the previous, parent or next data has a value.
- book_id: The book ID of the current outline being viewed. Same as the node ID containing the entire outline. Provided for context.
- book_url: The book/node URL of the current outline being viewed. Provided as an option. Not used by default.
- book_title: The book/node title of the current outline being viewed.
1 theme call to book-navigation.html.twig
- book_node_view in core/modules/ book/ book.module 
- Implements hook_ENTITY_TYPE_view() for node entities.
File
core/themes/olivero/templates/navigation/book-navigation.html.twigView source
- {#
- /**
-  * @file
-  * Theme override to navigate books.
-  *
-  * Presented under nodes that are a part of book outlines.
-  *
-  * Available variables:
-  * - tree: The immediate children of the current node rendered as an unordered
-  *   list.
-  * - current_depth: Depth of the current node within the book outline. Provided
-  *   for context.
-  * - prev_url: URL to the previous node.
-  * - prev_title: Title of the previous node.
-  * - parent_url: URL to the parent node.
-  * - parent_title: Title of the parent node. Not printed by default. Provided
-  *   as an option.
-  * - next_url: URL to the next node.
-  * - next_title: Title of the next node.
-  * - has_links: Flags TRUE whenever the previous, parent or next data has a
-  *   value.
-  * - book_id: The book ID of the current outline being viewed. Same as the node
-  *   ID containing the entire outline. Provided for context.
-  * - book_url: The book/node URL of the current outline being viewed. Provided
-  *   as an option. Not used by default.
-  * - book_title: The book/node title of the current outline being viewed.
-  *
-  * @see template_preprocess_book_navigation()
-  * @see olivero_preprocess_book_navigation()
-  */
- #}
- {{ attach_library('olivero/book') }}
- {% if tree or has_links %}
-   <nav id="book-navigation-{{ book_id }}" class="book-navigation" role="navigation" aria-labelledby="book-label-{{ book_id }}">
-     {{ tree }}
-     {% if has_links %}
-       <h2 class="visually-hidden" id="book-label-{{ book_id }}">{{ 'Book traversal links for'|t }} {{ book_title }}</h2>
-       <ul class="book-pager">
-       {% if prev_url %}
-         <li class="book-pager__item book-pager__item--previous">
-           <a class="book-pager__link book-pager__link--previous" href="{{ prev_url }}" rel="prev" title="{{ 'Go to previous page'|t }}">{{ prev_title }}</a>
-         </li>
-       {% endif %}
-       {% if parent_url %}
-         <li class="book-pager__item book-pager__item--center">
-           <a class="book-pager__link book-pager__link--center" href="{{ parent_url }}" title="{{ 'Go to parent page'|t }}">{{ 'Up'|t }}</a>
-         </li>
-       {% endif %}
-       {% if next_url %}
-         <li class="book-pager__item book-pager__item--next">
-           <a class="book-pager__link book-pager__link--next" href="{{ next_url }}" rel="next" title="{{ 'Go to next page'|t }}">{{ next_title }}</a>
-        </li>
-       {% endif %}
-     </ul>
-     {% endif %}
-   </nav>
- {% endif %}
