layout.html.twig

Same filename in this branch
  1. 8.9.x core/modules/layout_discovery/templates/layout.html.twig
Same filename and directory in other branches
  1. 9 core/themes/stable9/templates/layout/layout.html.twig
  2. 9 core/themes/stable/templates/layout/layout.html.twig
  3. 9 core/modules/layout_discovery/templates/layout.html.twig
  4. 10 core/themes/stable9/templates/layout/layout.html.twig
  5. 10 core/modules/layout_discovery/templates/layout.html.twig
  6. 11.x core/themes/stable9/templates/layout/layout.html.twig
  7. 11.x core/modules/layout_discovery/templates/layout.html.twig

Template for a generic layout.

3 theme calls to layout.html.twig
FieldLayoutBuilderTest::testBuildForm in core/modules/field_layout/tests/src/Unit/FieldLayoutBuilderTest.php
@covers ::buildForm @covers ::getFields
FieldLayoutBuilderTest::testBuildView in core/modules/field_layout/tests/src/Unit/FieldLayoutBuilderTest.php
@covers ::buildView @covers ::getFields
LayoutDefaultTest::testBuild in core/tests/Drupal/Tests/Core/Layout/LayoutDefaultTest.php
@covers ::build @dataProvider providerTestBuild

File

core/themes/stable/templates/layout/layout.html.twig

View source
  1. {#
  2. /**
  3. * @file
  4. * Template for a generic layout.
  5. */
  6. #}
  7. {%
  8. set classes = [
  9. 'layout',
  10. 'layout--' ~ layout.id|clean_class,
  11. ]
  12. %}
  13. {% if content %}
  14. <div{{ attributes.addClass(classes) }}>
  15. {% for region in layout.getRegionNames %}
  16. {% if content[region] %}
  17. <div {{ region_attributes[region].addClass('layout__region', 'layout__region--' ~ region|clean_class) }}>
  18. {{ content[region] }}
  19. </div>
  20. {% endif %}
  21. {% endfor %}
  22. </div>
  23. {% endif %}

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