layout--oneplusfourgrid-section.html.twig

Same filename in other branches
  1. 8.9.x core/profiles/demo_umami/themes/umami/layouts/oneplusfourgrid_section/layout--oneplusfourgrid-section.html.twig
  2. 10 core/profiles/demo_umami/themes/umami/layouts/oneplusfourgrid_section/layout--oneplusfourgrid-section.html.twig
  3. 11.x core/profiles/demo_umami/themes/umami/layouts/oneplusfourgrid_section/layout--oneplusfourgrid-section.html.twig

Default theme implementation to display a one plus four grid 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/profiles/demo_umami/themes/umami/layouts/oneplusfourgrid_section/layout--oneplusfourgrid-section.html.twig

View source
  1. {#
  2. /**
  3. * @file
  4. * Default theme implementation to display a one plus four grid 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--oneplusfourgrid-section',
  18. ]
  19. %}
  20. {% if content %}
  21. <div{{ attributes.addClass(classes) }}>
  22. {% if content.first %}
  23. <div{{ region_attributes.first.addClass('layout__region', 'layout__region--first') }}>
  24. {{ content.first }}
  25. </div>
  26. {% endif %}
  27. {% if content.second or content.third or content.fourth or content.fifth %}
  28. <div class="layout__four-grid-group">
  29. {% endif %}
  30. {% if content.second %}
  31. <div{{ region_attributes.second.addClass('layout__region', 'layout__region--second') }}>
  32. {{ content.second }}
  33. </div>
  34. {% endif %}
  35. {% if content.third %}
  36. <div{{ region_attributes.third.addClass('layout__region', 'layout__region--third') }}>
  37. {{ content.third }}
  38. </div>
  39. {% endif %}
  40. {% if content.fourth %}
  41. <div{{ region_attributes.fourth.addClass('layout__region', 'layout__region--fourth') }}>
  42. {{ content.fourth }}
  43. </div>
  44. {% endif %}
  45. {% if content.fifth %}
  46. <div{{ region_attributes.fifth.addClass('layout__region', 'layout__region--fifth') }}>
  47. {{ content.fifth }}
  48. </div>
  49. {% endif %}
  50. {% if content.second or content.third or content.fourth or content.fifth %}
  51. </div>
  52. {% endif %}
  53. </div>
  54. {% endif %}

Related topics


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