layout--twocol-section.html.twig

Same filename in this branch
  1. 11.x core/themes/stable9/layouts/layout_builder/twocol_section/layout--twocol-section.html.twig
Same filename and directory in other branches
  1. 9 core/themes/stable9/layouts/layout_builder/twocol_section/layout--twocol-section.html.twig
  2. 9 core/themes/stable/layouts/twocol_section/layout--twocol-section.html.twig
  3. 9 core/modules/layout_builder/layouts/twocol_section/layout--twocol-section.html.twig
  4. 8.9.x core/themes/stable/layouts/twocol_section/layout--twocol-section.html.twig
  5. 8.9.x core/modules/layout_builder/layouts/twocol_section/layout--twocol-section.html.twig
  6. 10 core/themes/stable9/layouts/layout_builder/twocol_section/layout--twocol-section.html.twig
  7. 10 core/modules/layout_builder/layouts/twocol_section/layout--twocol-section.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>.

File

core/modules/layout_builder/layouts/twocol_section/layout--twocol-section.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. {% if content %}
  15. <div{{ attributes }}>
  16. {% if content.first %}
  17. <div {{ region_attributes.first.addClass('layout__region', 'layout__region--first') }}>
  18. {{ content.first }}
  19. </div>
  20. {% endif %}
  21. {% if content.second %}
  22. <div {{ region_attributes.second.addClass('layout__region', 'layout__region--second') }}>
  23. {{ content.second }}
  24. </div>
  25. {% endif %}
  26. </div>
  27. {% endif %}

Related topics


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