annotate core/themes/classy/templates/navigation/book-navigation.html.twig @ 19:fa3358dc1485 tip

Add ndrum files
author Chris Cannam
date Wed, 28 Aug 2019 13:14:47 +0100
parents 4c8ae668cc8c
children
rev   line source
Chris@0 1 {#
Chris@0 2 /**
Chris@0 3 * @file
Chris@0 4 * Theme override to navigate books.
Chris@0 5 *
Chris@0 6 * Presented under nodes that are a part of book outlines.
Chris@0 7 *
Chris@0 8 * Available variables:
Chris@0 9 * - tree: The immediate children of the current node rendered as an unordered
Chris@0 10 * list.
Chris@0 11 * - current_depth: Depth of the current node within the book outline. Provided
Chris@0 12 * for context.
Chris@0 13 * - prev_url: URL to the previous node.
Chris@0 14 * - prev_title: Title of the previous node.
Chris@0 15 * - parent_url: URL to the parent node.
Chris@0 16 * - parent_title: Title of the parent node. Not printed by default. Provided
Chris@0 17 * as an option.
Chris@0 18 * - next_url: URL to the next node.
Chris@0 19 * - next_title: Title of the next node.
Chris@0 20 * - has_links: Flags TRUE whenever the previous, parent or next data has a
Chris@0 21 * value.
Chris@0 22 * - book_id: The book ID of the current outline being viewed. Same as the node
Chris@0 23 * ID containing the entire outline. Provided for context.
Chris@0 24 * - book_url: The book/node URL of the current outline being viewed. Provided
Chris@0 25 * as an option. Not used by default.
Chris@0 26 * - book_title: The book/node title of the current outline being viewed.
Chris@0 27 *
Chris@0 28 * @see template_preprocess_book_navigation()
Chris@0 29 */
Chris@0 30 #}
Chris@0 31 {{ attach_library('classy/book-navigation') }}
Chris@0 32 {% if tree or has_links %}
Chris@0 33 <nav id="book-navigation-{{ book_id }}" class="book-navigation" role="navigation" aria-labelledby="book-label-{{ book_id }}">
Chris@0 34 {{ tree }}
Chris@0 35 {% if has_links %}
Chris@0 36 <h2 class="visually-hidden" id="book-label-{{ book_id }}">{{ 'Book traversal links for'|t }} {{ book_title }}</h2>
Chris@0 37 <ul class="book-pager">
Chris@0 38 {% if prev_url %}
Chris@0 39 <li class="book-pager__item book-pager__item--previous">
Chris@0 40 <a href="{{ prev_url }}" rel="prev" title="{{ 'Go to previous page'|t }}"><b>{{ '‹'|t }}</b> {{ prev_title }}</a>
Chris@0 41 </li>
Chris@0 42 {% endif %}
Chris@0 43 {% if parent_url %}
Chris@0 44 <li class="book-pager__item book-pager__item--center">
Chris@0 45 <a href="{{ parent_url }}" title="{{ 'Go to parent page'|t }}">{{ 'Up'|t }}</a>
Chris@0 46 </li>
Chris@0 47 {% endif %}
Chris@0 48 {% if next_url %}
Chris@0 49 <li class="book-pager__item book-pager__item--next">
Chris@0 50 <a href="{{ next_url }}" rel="next" title="{{ 'Go to next page'|t }}">{{ next_title }} <b>{{ '›'|t }}</b></a>
Chris@0 51 </li>
Chris@0 52 {% endif %}
Chris@0 53 </ul>
Chris@0 54 {% endif %}
Chris@0 55 </nav>
Chris@0 56 {% endif %}