This repository has been archived on 2025-01-19. You can view files and clone it, but cannot push or open issues or pull requests.
drupalcampbristol/web/core/modules/book/templates/book-navigation.html.twig
2017-02-13 15:31:17 +00:00

58 lines
1.9 KiB
Twig
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{#
/**
* @file
* Default theme implementation 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()
*
* @ingroup themeable
*/
#}
{% if tree or has_links %}
<nav role="navigation" aria-labelledby="book-label-{{ book_id }}">
{{ tree }}
{% if has_links %}
<h2>{{ 'Book traversal links for'|t }} {{ book_title }}</h2>
<ul>
{% if prev_url %}
<li>
<a href="{{ prev_url }}" rel="prev" title="{{ 'Go to previous page'|t }}"><b>{{ ''|t }}</b> {{ prev_title }}</a>
</li>
{% endif %}
{% if parent_url %}
<li>
<a href="{{ parent_url }}" title="{{ 'Go to parent page'|t }}">{{ 'Up'|t }}</a>
</li>
{% endif %}
{% if next_url %}
<li>
<a href="{{ next_url }}" rel="next" title="{{ 'Go to next page'|t }}">{{ next_title }} <b>{{ ''|t }}</b></a>
</li>
{% endif %}
</ul>
{% endif %}
</nav>
{% endif %}