block--navigation.html.twig

Same filename and directory in other branches
  1. 10 core/modules/navigation/templates/block--navigation.html.twig

Default theme implementation to display a navigation_block.

Available variables:

  • plugin_id: The ID of the navigation_block implementation.
  • label: The configured label of the navigation_block if visible.
  • configuration: A list of the navigation_block's configuration values.
    • label: The configured label for the navigation_block.
    • label_display: The display settings for the label.
    • provider: The module or other provider that provided this navigation_block plugin.
    • Navigation block plugin specific settings will also be stored here.
  • content: The content of this navigation_block.
  • attributes: array of HTML attributes populated by modules, intended to be added to the main container tag of this template.

    • id: A valid HTML ID and guaranteed unique.
  • title_attributes: Same as attributes, except applied to the main title tag that appears in the template.
  • title_prefix: Additional output populated by modules, intended to be displayed in front of the main title tag that appears in the template.
  • title_suffix: Additional output populated by modules, intended to be displayed after the main title tag that appears in the template.

See also

template_preprocess_navigation_block()

File

core/modules/navigation/templates/block--navigation.html.twig

View source
  1. {#
  2. /**
  3. * @file
  4. * Default theme implementation to display a navigation_block.
  5. *
  6. * Available variables:
  7. * - plugin_id: The ID of the navigation_block implementation.
  8. * - label: The configured label of the navigation_block if visible.
  9. * - configuration: A list of the navigation_block's configuration values.
  10. * - label: The configured label for the navigation_block.
  11. * - label_display: The display settings for the label.
  12. * - provider: The module or other provider that provided this
  13. navigation_block plugin.
  14. * - Navigation block plugin specific settings will also be stored here.
  15. * - content: The content of this navigation_block.
  16. * - attributes: array of HTML attributes populated by modules, intended to
  17. * be added to the main container tag of this template.
  18. * - id: A valid HTML ID and guaranteed unique.
  19. * - title_attributes: Same as attributes, except applied to the main title
  20. * tag that appears in the template.
  21. * - title_prefix: Additional output populated by modules, intended to be
  22. * displayed in front of the main title tag that appears in the template.
  23. * - title_suffix: Additional output populated by modules, intended to be
  24. * displayed after the main title tag that appears in the template.
  25. *
  26. * @see template_preprocess_navigation_block()
  27. *
  28. * @ingroup themeable
  29. */
  30. #}
  31. <div{{ attributes.addClass('toolbar-block') }}>
  32. {{ title_prefix }}
  33. {% if label %}
  34. <h2{{ title_attributes.addClass('toolbar-block__title').setAttribute('data-drupal-tooltip', label).setAttribute('data-drupal-tooltip-class', 'toolbar-block__title-tooltip') }}>{{ label }}</h2>
  35. {% endif %}
  36. {{ title_suffix }}
  37. {% block content %}
  38. {{ content }}
  39. {% endblock %}
  40. </div>

Related topics


Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.