annotate core/modules/system/templates/block--system-menu-block.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 * Default theme implementation for a menu block.
Chris@0 5 *
Chris@0 6 * Available variables:
Chris@0 7 * - plugin_id: The ID of the block implementation.
Chris@0 8 * - label: The configured label of the block if visible.
Chris@0 9 * - configuration: A list of the block's configuration values.
Chris@0 10 * - label: The configured label for the block.
Chris@0 11 * - label_display: The display settings for the label.
Chris@0 12 * - provider: The module or other provider that provided this block plugin.
Chris@0 13 * - Block plugin specific settings will also be stored here.
Chris@0 14 * - content: The content of this block.
Chris@0 15 * - attributes: HTML attributes for the containing element.
Chris@0 16 * - id: A valid HTML ID and guaranteed unique.
Chris@0 17 * - title_attributes: HTML attributes for the title element.
Chris@0 18 * - content_attributes: HTML attributes for the content element.
Chris@0 19 * - title_prefix: Additional output populated by modules, intended to be
Chris@0 20 * displayed in front of the main title tag that appears in the template.
Chris@0 21 * - title_suffix: Additional output populated by modules, intended to be
Chris@0 22 * displayed after the main title tag that appears in the template.
Chris@0 23 *
Chris@0 24 * Headings should be used on navigation menus that consistently appear on
Chris@0 25 * multiple pages. When this menu block's label is configured to not be
Chris@0 26 * displayed, it is automatically made invisible using the 'visually-hidden' CSS
Chris@0 27 * class, which still keeps it visible for screen-readers and assistive
Chris@0 28 * technology. Headings allow screen-reader and keyboard only users to navigate
Chris@0 29 * to or skip the links.
Chris@0 30 * See http://juicystudio.com/article/screen-readers-display-none.php and
Chris@0 31 * http://www.w3.org/TR/WCAG-TECHS/H42.html for more information.
Chris@0 32 *
Chris@0 33 * @ingroup themeable
Chris@0 34 */
Chris@0 35 #}
Chris@0 36 {% set heading_id = attributes.id ~ '-menu'|clean_id %}
Chris@0 37 <nav role="navigation" aria-labelledby="{{ heading_id }}"{{ attributes|without('role', 'aria-labelledby') }}>
Chris@0 38 {# Label. If not displayed, we still provide it for screen readers. #}
Chris@0 39 {% if not configuration.label_display %}
Chris@0 40 {% set title_attributes = title_attributes.addClass('visually-hidden') %}
Chris@0 41 {% endif %}
Chris@0 42 {{ title_prefix }}
Chris@0 43 <h2{{ title_attributes.setAttribute('id', heading_id) }}>{{ configuration.label }}</h2>
Chris@0 44 {{ title_suffix }}
Chris@0 45
Chris@0 46 {# Menu. #}
Chris@0 47 {% block content %}
Chris@0 48 {{ content }}
Chris@0 49 {% endblock %}
Chris@0 50 </nav>