You are here

page-title.html.twig in Drupal 10

Olivero's theme implementation for a page title.

Available variables:

  • title_attributes: HTML attributes for the page title element.
  • title_prefix: Additional output populated by modules, intended to be displayed in front of the main title tag that appears in the template.
  • title: The page title, for use in the actual content.
  • title_suffix: Additional output populated by modules, intended to be displayed after the main title tag that appears in the template.

File

core/themes/olivero/templates/content/page-title.html.twig
View source
  1. {#
  2. /**
  3. * @file
  4. * Olivero's theme implementation for a page title.
  5. *
  6. * Available variables:
  7. * - title_attributes: HTML attributes for the page title element.
  8. * - title_prefix: Additional output populated by modules, intended to be
  9. * displayed in front of the main title tag that appears in the template.
  10. * - title: The page title, for use in the actual content.
  11. * - title_suffix: Additional output populated by modules, intended to be
  12. * displayed after the main title tag that appears in the template.
  13. */
  14. #}
  15. {%
  16. set classes = [
  17. 'title',
  18. 'page-title',
  19. ]
  20. %}
  21. {{ title_prefix }}
  22. {% if title|render|striptags|trim %}
  23. <h1{{ title_attributes.addClass(classes) }}>{{ title }}</h1>
  24. {% endif %}
  25. {{ title_suffix }}