region.html.twig

Default theme implementation to display a region.

Available variables:

  • content: The content for this region, typically blocks.
  • attributes: HTML attributes for the region div, including:
    • class: Classes that can be used to style contextually through CSS, including:

      • region: The current template type (also know as "theming hook").
      • region-[name]: The name of the region with underscores replaced with dashes. For example, page_top region would have a region-page-top class.
  • region: The name of the region variable as defined in the theme's .info.yml file.

See also

template_preprocess()

template_preprocess_region()

File

drupal/core/modules/system/templates/region.html.twig
View source
  1. {#
  2. /**
  3. * @file
  4. * Default theme implementation to display a region.
  5. *
  6. * Available variables:
  7. * - content: The content for this region, typically blocks.
  8. * - attributes: HTML attributes for the region div, including:
  9. * - class: Classes that can be used to style contextually through CSS,
  10. * including:
  11. * - region: The current template type (also know as "theming hook").
  12. * - region-[name]: The name of the region with underscores replaced with
  13. * dashes. For example, page_top region would have a region-page-top
  14. * class.
  15. * - region: The name of the region variable as defined in the theme's
  16. * .info.yml file.
  17. *
  18. * @see template_preprocess()
  19. * @see template_preprocess_region()
  20. *
  21. * @ingroup themeable
  22. */
  23. #}
  24. {% if content %}
  25. <div{{ attributes }}>
  26. {{ content }}
  27. </div>
  28. {% endif %}

Related topics