layout--twocol-bricks.html.twig

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

Theme override for a two column layout.

This template provides a two column display layout with full width areas at the top, bottom and in the middle.

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_discovery/twocol_bricks/layout--twocol-bricks.html.twig

View source
  1. {#
  2. /**
  3. * @file
  4. * Theme override for a two column layout.
  5. *
  6. * This template provides a two column display layout with full width areas at
  7. * the top, bottom and in the middle.
  8. *
  9. * Available variables:
  10. * - in_preview: Whether the plugin is being rendered in preview mode.
  11. * - content: The content for this layout.
  12. * - attributes: HTML attributes for the layout <div>.
  13. */
  14. #}
  15. {%
  16. set classes = [
  17. 'layout',
  18. 'layout--twocol-bricks',
  19. ]
  20. %}
  21. {% if content %}
  22. <div{{ attributes.addClass(classes) }}>
  23. {% if content.top %}
  24. <div {{ region_attributes.top.addClass('layout__region', 'layout__region--top') }}>
  25. {{ content.top }}
  26. </div>
  27. {% endif %}
  28. {% if content.first_above %}
  29. <div {{ region_attributes.first_above.addClass('layout__region', 'layout__region--first-above') }}>
  30. {{ content.first_above }}
  31. </div>
  32. {% endif %}
  33. {% if content.second_above %}
  34. <div {{ region_attributes.second_above.addClass('layout__region', 'layout__region--second-above') }}>
  35. {{ content.second_above }}
  36. </div>
  37. {% endif %}
  38. {% if content.middle %}
  39. <div {{ region_attributes.middle.addClass('layout__region', 'layout__region--middle') }}>
  40. {{ content.middle }}
  41. </div>
  42. {% endif %}
  43. {% if content.first_below %}
  44. <div {{ region_attributes.first_below.addClass('layout__region', 'layout__region--first-below') }}>
  45. {{ content.first_below }}
  46. </div>
  47. {% endif %}
  48. {% if content.second_below %}
  49. <div {{ region_attributes.second_below.addClass('layout__region', 'layout__region--second-below') }}>
  50. {{ content.second_below }}
  51. </div>
  52. {% endif %}
  53. {% if content.bottom %}
  54. <div {{ region_attributes.bottom.addClass('layout__region', 'layout__region--bottom') }}>
  55. {{ content.bottom }}
  56. </div>
  57. {% endif %}
  58. </div>
  59. {% endif %}

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