top-bar-page-actions.html.twig
Default theme implementation for navigation top bar page actions.
Available variables:
- page_actions: Array of page actions for the current route.
- featured_page_actions: The page actions to show featured before the dropdown.
1 theme call to top-bar-page-actions.html.twig
- PageActions::build in core/
modules/ navigation/ src/ Plugin/ TopBarItem/ PageActions.php
File
-
core/
modules/ navigation/ templates/ top-bar-page-actions.html.twig
View source
- {#
- /**
- * @file
- * Default theme implementation for navigation top bar page actions.
- *
- * Available variables:
- * - page_actions: Array of page actions for the current route.
- * - featured_page_actions: The page actions to show featured before the dropdown.
- */
- #}
- {% set dropdown_id = 'top-bar-page-actions'|clean_unique_id %}
-
- {% for featured_page_action in featured_page_actions %}
- {% set link = featured_page_action.page_action['#link'] %}
- {% include 'navigation:toolbar-button' with {
- text: link['#title'],
- html_tag: 'a',
- attributes: create_attribute().setAttribute('href', link['#url']|render|default(null)),
- modifiers: ['primary'],
- icon: featured_page_action.icon,
- } only %}
- {% endfor %}
-
- {% include 'navigation:toolbar-button' with {
- icon: 'dots',
- attributes: create_attribute(
- {
- 'aria-expanded': 'false',
- 'aria-controls': dropdown_id,
- 'data-drupal-dropdown': 'true'
- }
- ),
- } only %}
-
- <div class="toolbar-dropdown__menu" id={{ dropdown_id }}>
- <ul class="toolbar-dropdown__list">
- {% for page_action in page_actions %}
- {{ page_action }}
- {% endfor %}
- </ul>
- </div>
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.