layout--twocol.html.twig
Same filename in this branch
Same filename in other branches
- 8.9.x core/themes/stable/templates/layout/layout--twocol.html.twig
- 8.9.x core/modules/layout_discovery/layouts/twocol/layout--twocol.html.twig
- 10 core/themes/stable9/layouts/layout_discovery/twocol/layout--twocol.html.twig
- 10 core/modules/layout_discovery/layouts/twocol/layout--twocol.html.twig
- 11.x core/themes/stable9/layouts/layout_discovery/twocol/layout--twocol.html.twig
- 11.x core/modules/layout_discovery/layouts/twocol/layout--twocol.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>.
2 theme calls to layout--twocol.html.twig
- FieldLayoutBuilderTest::testBuildForm in core/
modules/ field_layout/ tests/ src/ Unit/ FieldLayoutBuilderTest.php - @covers ::buildForm @covers ::getFields
- FieldLayoutBuilderTest::testBuildView in core/
modules/ field_layout/ tests/ src/ Unit/ FieldLayoutBuilderTest.php - @covers ::buildView @covers ::getFields
File
-
core/
modules/ layout_discovery/ layouts/ twocol/ layout--twocol.html.twig
View source
- {#
- /**
- * @file
- * 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>.
- *
- * @ingroup themeable
- */
- #}
- {%
- set classes = [
- 'layout',
- 'layout--twocol',
- ]
- %}
- {% if content %}
- <div{{ attributes.addClass(classes) }}>
- {% if content.top %}
- <div {{ region_attributes.top.addClass('layout__region', 'layout__region--top') }}>
- {{ content.top }}
- </div>
- {% endif %}
-
- {% if content.first %}
- <div {{ region_attributes.first.addClass('layout__region', 'layout__region--first') }}>
- {{ content.first }}
- </div>
- {% endif %}
-
- {% if content.second %}
- <div {{ region_attributes.second.addClass('layout__region', 'layout__region--second') }}>
- {{ content.second }}
- </div>
- {% endif %}
-
- {% if content.bottom %}
- <div {{ region_attributes.bottom.addClass('layout__region', 'layout__region--bottom') }}>
- {{ content.bottom }}
- </div>
- {% endif %}
- </div>
- {% endif %}
Related topics
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.