layout--twocol.html.twig

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

Default theme implementation to display a two-column layout.

Available variables:

  • in_preview: Whether the plugin is being rendered in preview mode.
  • content: The content for this layout.
  • attributes: HTML attributes for the layout <div>.
2 theme calls to layout--twocol.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

File

core/modules/layout_discovery/layouts/twocol/layout--twocol.html.twig

View source
  1. {#
  2. /**
  3. * @file
  4. * Default theme implementation to display a two-column layout.
  5. *
  6. * Available variables:
  7. * - in_preview: Whether the plugin is being rendered in preview mode.
  8. * - content: The content for this layout.
  9. * - attributes: HTML attributes for the layout <div>.
  10. *
  11. * @ingroup themeable
  12. */
  13. #}
  14. {%
  15. set classes = [
  16. 'layout',
  17. 'layout--twocol',
  18. ]
  19. %}
  20. {% if content %}
  21. <div{{ attributes.addClass(classes) }}>
  22. {% if content.top %}
  23. <div {{ region_attributes.top.addClass('layout__region', 'layout__region--top') }}>
  24. {{ content.top }}
  25. </div>
  26. {% endif %}
  27. {% if content.first %}
  28. <div {{ region_attributes.first.addClass('layout__region', 'layout__region--first') }}>
  29. {{ content.first }}
  30. </div>
  31. {% endif %}
  32. {% if content.second %}
  33. <div {{ region_attributes.second.addClass('layout__region', 'layout__region--second') }}>
  34. {{ content.second }}
  35. </div>
  36. {% endif %}
  37. {% if content.bottom %}
  38. <div {{ region_attributes.bottom.addClass('layout__region', 'layout__region--bottom') }}>
  39. {{ content.bottom }}
  40. </div>
  41. {% endif %}
  42. </div>
  43. {% endif %}

Related topics


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