layout--fourcol-section.html.twig

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

Theme override for a four-column 25%-25%-25%-25% 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/themes/stable9/layouts/layout_builder/fourcol_section/layout--fourcol-section.html.twig

View source
  1. {#
  2. /**
  3. * @file
  4. * Theme override for a four-column 25%-25%-25%-25% 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. #}
  12. {%
  13. set classes = [
  14. 'layout',
  15. 'layout--fourcol-section',
  16. ]
  17. %}
  18. {% if content %}
  19. <div{{ attributes.addClass(classes) }}>
  20. {% if content.first %}
  21. <div {{ region_attributes.first.addClass('layout__region', 'layout__region--first') }}>
  22. {{ content.first }}
  23. </div>
  24. {% endif %}
  25. {% if content.second %}
  26. <div {{ region_attributes.second.addClass('layout__region', 'layout__region--second') }}>
  27. {{ content.second }}
  28. </div>
  29. {% endif %}
  30. {% if content.third %}
  31. <div {{ region_attributes.third.addClass('layout__region', 'layout__region--third') }}>
  32. {{ content.third }}
  33. </div>
  34. {% endif %}
  35. {% if content.fourth %}
  36. <div {{ region_attributes.fourth.addClass('layout__region', 'layout__region--fourth') }}>
  37. {{ content.fourth }}
  38. </div>
  39. {% endif %}
  40. </div>
  41. {% endif %}

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