{#
Rich Text Marginals
===================
#}
{# -- Set Vars -- #}
{% set classname = name is defined and name is not empty ? name : 'm-richTextMarginals' %}
{# -- Modul -- #}
{% if data.children is not empty %}
{% set childs = data.children %}
{% set firstColumn = false %}
{% set lastColumn = false %}
{# Check if it more as one Marginal Column #}
{% if childs.total > 1 %}
{# Get first and last Marginal Column #}
{% set firstColumn = childs.first() is defined ? childs.first() %}
{% set lastColumn = childs.last() is defined ? childs.last() %}
{# Check if left Column has Content #}
{% if firstColumn %}
{# Loop through the Columns and Include the right Modul #}
{% if firstColumn.children is not empty %}
{% for marginalColumn in firstColumn.children %}
{% include '_contentBuilders/_contentBuilderModules' with { data: marginalColumn } %}
{% endfor %}
{% endif %}
{% endif %}
{# Rich Text Field #}
{{ data.singleRichText }}
{# Check if right Column has Content #}
{% if lastColumn %}
{# Loop through the Columns and Include the right Modul #}
{% if lastColumn.children is not empty %}
{% for marginalColumn in lastColumn.children %}
{% include '_contentBuilders/_contentBuilderModules' with { data: marginalColumn } %}
{% endfor %}
{% endif %}
{% endif %}
{% else %}
{# Get first Marginal Column #}
{% set firstColumn = childs.first() is defined ? childs.first() %}
{# Check if left Column has Content #}
{% if firstColumn %}
{# Loop through the Columns and Include the right Modul #}
{% if firstColumn.children is not empty %}
{% for marginalColumn in firstColumn.children %}
{% include '_contentBuilders/_contentBuilderModules' with { data: marginalColumn } %}
{% endfor %}
{% endif %}
{% endif %}
{# Rich Text Field #}