diff --git a/layouts/edge-to-edge/layout--edge-to-edge.html.twig b/layouts/edge-to-edge/layout--edge-to-edge.html.twig
index 5d82045..ac94ddb 100644
--- a/layouts/edge-to-edge/layout--edge-to-edge.html.twig
+++ b/layouts/edge-to-edge/layout--edge-to-edge.html.twig
@@ -1,7 +1,7 @@
{#
/**
* @file
- * Default theme implementation to display a one-column layout.
+ * Default theme implementation to display an edge-to-edge layout.
*
* Available variables:
* - content: The content for this layout.
@@ -15,63 +15,51 @@
{{ attach_library('ucb_bootstrap_layouts/ucb-bootstrap-layouts') }}
{% set sectionID = settings.sectionID %}
+{% set row_classes = ['row', 'ucb-bootstrap-layout__row', 'ucb-bootstrap-layout__row--one-column', 'g-0'] %}
+{% set frameColor = 'content-frame-' ~ settings.content_frame_color %}
+{% set frameStyle = settings.content_frame_color == 'none' ? 'content-frame-unstyled' : 'content-frame-styled' %}
+{% set frame_classes = ['ucb-content-frame', frameColor, frameStyle] %}
+{% set regions = ['first'] %}
-{%
- set row_classes = [
- 'row',
- 'ucb-bootstrap-layout__row',
- 'ucb-bootstrap-layout__row--one-column',
- 'g-0'
- ]
-%}
+
{% if content %}
-
-
-
-
- {{ content.first }}
-
-
-
-
+
+
+
+ {% for region in regions %}
+ {% if content[region] and content[region]|render|striptags('
+
+
{% endif %}
diff --git a/layouts/four-column/layout--four-column.html.twig b/layouts/four-column/layout--four-column.html.twig
index c4f73e2..6430448 100644
--- a/layouts/four-column/layout--four-column.html.twig
+++ b/layouts/four-column/layout--four-column.html.twig
@@ -12,140 +12,79 @@
*/
#}
-{# Get the column widths #}
-
{{ attach_library('ucb_bootstrap_layouts/ucb-bootstrap-layouts') }}
{% set sectionID = settings.sectionID %}
-
{% set column_widths = settings.column_width|split('-') %}
-
-{%
- set row_classes = [
- 'row',
- 'ucb-bootstrap-layout__row',
- 'ucb-bootstrap-layout__row--four-column'
- ]
-%}
-
-{%
- set frameColor = 'content-frame-' ~ settings.content_frame_color
-%}
-
-{% if settings.content_frame_color == 'none' %}
- {% set frameStyle = 'content-frame-unstyled' %}
-{% else %}
- {% set frameStyle = 'content-frame-styled' %}
-{% endif %}
-
-{%
- set frame_classes = [
- 'ucb-content-frame',
- frameColor,
- frameStyle
- ]
-%}
-
-{% if settings.column_equal_height == '1' %}
- {% set columnHeight = 'd-flex flex-wrap' %}
-{% else %}
- {% set columnHeight = '' %}
-{% endif %}
-
-{% if settings.background_image_styles %}
- {% if settings.overlay_color == 'black' %}
- {% set row_overlay_settings = "ucb-bootstrap-layout-section-overlay-dark" %}
- {% elseif settings.overlay_color == 'white' %}
- {% set row_overlay_settings = "ucb-bootstrap-layout-section-overlay-light" %}
- {% else %}
- {% set row_overlay_settings = "ucb-bootstrap-layout-section-overlay-none" %}
- {% endif %}
-{% else %}
- {% set row_overlay_settings = "" %}
-{% endif %}
-
-{% if settings.background_effect == "fixed" %}
- {% set row_background_effect = "fixed-background" %}
-{% elseif settings.background_effect == "parallax" %}
- {% set row_background_effect = "jarallax" %}
-{% else %}
- {% set row_background_effect = "scrolling-background" %}
-{% endif %}
-
-{% if settings.background_effect == "parallax" %}
-
-{% endif %}
+{% set row_classes = ['row', 'ucb-bootstrap-layout__row', 'ucb-bootstrap-layout__row--four-column'] %}
+{% set frameColor = 'content-frame-' ~ settings.content_frame_color %}
+{% set frameStyle = settings.content_frame_color == 'none' ? 'content-frame-unstyled' : 'content-frame-styled' %}
+{% set frame_classes = ['ucb-content-frame', frameColor, frameStyle] %}
+{% set columnHeight = settings.column_equal_height == '1' ? 'd-flex flex-wrap' : '' %}
+{% set regions = ['first', 'second', 'third', 'fourth'] %}
{% if content %}
-
-
-
- {% if content.first %}
-
- {{ content.first }}
-
- {% endif %}
-
- {% if content.second %}
-
- {{ content.second }}
-
- {% endif %}
-
- {% if content.third %}
-
- {{ content.third }}
-
- {% endif %}
-
- {% if content.fourth %}
-
- {{ content.fourth }}
-
- {% endif %}
-
-
-
+
+
+
+ {% for i in 0..(regions|length - 1) %}
+ {% set region = regions[i] %}
+ {% set width = column_widths[i] %}
+ {% if content[region] and content[region]|render|striptags('
+ {% for region in ['first'] %}
+ {% if content[region] and content[region]|render|striptags('
+
+
{% endif %}
-
-
diff --git a/layouts/three-column/layout--three-column.html.twig b/layouts/three-column/layout--three-column.html.twig
index 515d9e2..7b6fe15 100644
--- a/layouts/three-column/layout--three-column.html.twig
+++ b/layouts/three-column/layout--three-column.html.twig
@@ -12,134 +12,81 @@
*/
#}
-{# Get the column widths #}
-
{{ attach_library('ucb_bootstrap_layouts/ucb-bootstrap-layouts') }}
{% set sectionID = settings.sectionID %}
-
{% set column_widths = settings.column_width|split('-') %}
-
-{%
- set row_classes = [
- 'row',
- 'ucb-bootstrap-layout__row',
- 'ucb-bootstrap-layout__row--three-column'
- ]
-%}
-
-{%
- set frameColor = 'content-frame-' ~ settings.content_frame_color
-%}
-
-{% if settings.content_frame_color == 'none' %}
- {% set frameStyle = 'content-frame-unstyled' %}
-{% else %}
- {% set frameStyle = 'content-frame-styled' %}
-{% endif %}
-
-{%
- set frame_classes = [
- 'ucb-content-frame',
- frameColor,
- frameStyle
- ]
-%}
-
-{% if settings.column_equal_height == '1' %}
- {% set columnHeight = 'd-flex flex-wrap' %}
-{% else %}
- {% set columnHeight = '' %}
-{% endif %}
-
-{% if settings.background_image_styles %}
- {% if settings.overlay_color == 'black' %}
- {% set row_overlay_settings = "ucb-bootstrap-layout-section-overlay-dark" %}
- {% elseif settings.overlay_color == 'white' %}
- {% set row_overlay_settings = "ucb-bootstrap-layout-section-overlay-light" %}
- {% else %}
- {% set row_overlay_settings = "ucb-bootstrap-layout-section-overlay-none" %}
- {% endif %}
-{% else %}
- {% set row_overlay_settings = "" %}
-{% endif %}
-
-{% if settings.background_effect == "fixed" %}
- {% set row_background_effect = "fixed-background" %}
-{% elseif settings.background_effect == "parallax" %}
- {% set row_background_effect = "jarallax" %}
-{% else %}
- {% set row_background_effect = "scrolling-background" %}
-{% endif %}
-
-{% if settings.background_effect == "parallax" %}
-
-{% endif %}
+{% set row_classes = ['row', 'ucb-bootstrap-layout__row', 'ucb-bootstrap-layout__row--three-column'] %}
+{% set frameStyle = settings.content_frame_color == 'none' ? 'content-frame-unstyled' : 'content-frame-styled' %}
+{% set frame_classes = ['ucb-content-frame', frameColor, frameStyle] %}
+{% set columnHeight = settings.column_equal_height == '1' ? 'd-flex flex-wrap' : '' %}
+{% set regions = ['first', 'second', 'third'] %}
+{% set max_width = column_widths|sort|last %}
+{% set all_equal = column_widths|length == column_widths|filter(width => width == column_widths[0])|length %}
{% if content %}
-
-
-
- {% if content.first %}
-
- {{ content.first }}
-
- {% endif %}
-
- {% if content.second %}
-
- {{ content.second }}
-
- {% endif %}
-
- {% if content.third %}
-
- {{ content.third }}
-
- {% endif %}
-
-
-
+
+
+
+ {% for i in 0..(regions|length - 1) %}
+ {% set region = regions[i] %}
+ {% set width = column_widths[i] %}
+ {% set column_class = all_equal or width == max_width ? 'main-column' : 'auxiliary-column' %}
+ {% if content[region] and content[region]|render|striptags('
+
+
{% endif %}
diff --git a/layouts/two-column/layout--two-column.html.twig b/layouts/two-column/layout--two-column.html.twig
index 7e66abc..ea5e6fc 100644
--- a/layouts/two-column/layout--two-column.html.twig
+++ b/layouts/two-column/layout--two-column.html.twig
@@ -12,127 +12,82 @@
*/
#}
-{# Get the column widths #}
-
{{ attach_library('ucb_bootstrap_layouts/ucb-bootstrap-layouts') }}
{% set sectionID = settings.sectionID %}
-
{% set column_widths = settings.column_width|split('-') %}
-
-{%
- set row_classes = [
- 'row',
- 'ucb-bootstrap-layout__row',
- 'ucb-bootstrap-layout__row--two-column'
- ]
-%}
-
-{%
- set frameColor = 'content-frame-' ~ settings.content_frame_color
-%}
-
-{% if settings.content_frame_color == 'none' %}
- {% set frameStyle = 'content-frame-unstyled' %}
-{% else %}
- {% set frameStyle = 'content-frame-styled' %}
-{% endif %}
-
-{% if settings.column_equal_height == '1' %}
- {% set columnHeight = 'd-flex flex-wrap' %}
-{% else %}
- {% set columnHeight = '' %}
-{% endif %}
-
-{%
- set frame_classes = [
- 'ucb-content-frame',
- frameColor,
- frameStyle
- ]
-%}
-
-{% if settings.background_image_styles %}
- {% if settings.overlay_color == 'black' %}
- {% set row_overlay_settings = "ucb-bootstrap-layout-section-overlay-dark" %}
- {% elseif settings.overlay_color == 'white' %}
- {% set row_overlay_settings = "ucb-bootstrap-layout-section-overlay-light" %}
- {% else %}
- {% set row_overlay_settings = "ucb-bootstrap-layout-section-overlay-none" %}
- {% endif %}
-{% else %}
- {% set row_overlay_settings = "" %}
-{% endif %}
-
-{% if settings.background_effect == "fixed" %}
- {% set row_background_effect = "fixed-background" %}
-{% elseif settings.background_effect == "parallax" %}
- {% set row_background_effect = "jarallax" %}
-{% else %}
- {% set row_background_effect = "scrolling-background" %}
-{% endif %}
-
-{% if settings.background_effect == "parallax" %}
-
-{% endif %}
+{% set row_classes = ['row', 'ucb-bootstrap-layout__row', 'ucb-bootstrap-layout__row--two-column'] %}
+{% set frameColor = 'content-frame-' ~ settings.content_frame_color %}
+{% set frameStyle = settings.content_frame_color == 'none' ? 'content-frame-unstyled' : 'content-frame-styled' %}
+{% set frame_classes = ['ucb-content-frame', frameColor, frameStyle] %}
+{% set columnHeight = settings.column_equal_height == '1' ? 'd-flex flex-wrap' : '' %}
+{% set regions = ['first', 'second'] %}
+{% set max_width = column_widths|sort|last %}
+{% set all_equal = column_widths|length == column_widths|filter(width => width == column_widths[0])|length %}
{% if content %}
-
-
-
- {% if (content.first) and (content.first|render|striptags('
-
-
+
+
+
+ {% for i in 0..(regions|length - 1) %}
+ {% set region = regions[i] %}
+ {% set width = column_widths[i] %}
+ {% set column_class = all_equal or width == max_width ? 'main-column' : 'auxiliary-column' %}
+ {% if content[region] and content[region]|render|striptags('')|trim != '' %}
+