You are here

layout--twocol.html.twig in Drupal 9

Theme override to display a two-column layout.

Available variables:

  • content: The content for this layout.
  • attributes: HTML attributes for the layout <div>.

File

core/themes/stable9/layouts/layout_discovery/twocol/layout--twocol.html.twig
View source
  1. {#
  2. /**
  3. * @file
  4. * Theme override to display a two-column layout.
  5. *
  6. * Available variables:
  7. * - content: The content for this layout.
  8. * - attributes: HTML attributes for the layout <div>.
  9. */
  10. #}
  11. {%
  12. set classes = [
  13. 'layout',
  14. 'layout--twocol',
  15. ]
  16. %}
  17. {% if content %}
  18. <div{{ attributes.addClass(classes) }}>
  19. {% if content.top %}
  20. <div {{ region_attributes.top.addClass('layout__region', 'layout__region--top') }}>
  21. {{ content.top }}
  22. </div>
  23. {% endif %}
  24. {% if content.first %}
  25. <div {{ region_attributes.first.addClass('layout__region', 'layout__region--first') }}>
  26. {{ content.first }}
  27. </div>
  28. {% endif %}
  29. {% if content.second %}
  30. <div {{ region_attributes.second.addClass('layout__region', 'layout__region--second') }}>
  31. {{ content.second }}
  32. </div>
  33. {% endif %}
  34. {% if content.bottom %}
  35. <div {{ region_attributes.bottom.addClass('layout__region', 'layout__region--bottom') }}>
  36. {{ content.bottom }}
  37. </div>
  38. {% endif %}
  39. </div>
  40. {% endif %}