rocketship_paragraphs-5.0.0-alpha8/templates/rs--field--paragraph--p-012-children.html.twig
templates/rs--field--paragraph--p-012-children.html.twig
{#
/**
* Guidance boxes
*
* This makes up the columns wrappers around the individual boxes
*
* Available variables:
* - attributes: HTML attributes for the containing element.
* - label_hidden: Whether to show the field label or not.
* - title_attributes: HTML attributes for the title.
* - label: The label for the field.
* - multiple: TRUE if a field can contain multiple items.
* - items: List of all the field items. Each item contains:
* - attributes: List of HTML attributes for each item.
* - content: The field item's content.
* - entity_type: The entity type to which the field belongs.
* - field_name: The name of the field.
* - field_type: The type of the field.
* - label_display: The display settings for the label.
*/
#}
{%
set classes = [
field_name|clean_class,
]
%}
{# output the boxes with custom wrappers #}
{% if field_name == 'field_p_012_children' %}
{% if attributes.hasClass('p-012--view-mode--4-mixed') %}
{% for row in items|batch(4) %}
<div{{ attributes.addClass(classes) }}>
<div class="p-012__row">
{% for column in row %}
{{ column.content }}
{% endfor %}
</div>
</div>
{% endfor %}
{% elseif attributes.hasClass('p-012--view-mode--5-mixed') %}
{% for row in items|batch(5) %}
<div{{ attributes.addClass(classes) }}>
<div class="p-012__row">
{% for column in row %}
{{ column.content }}
{% endfor %}
</div>
</div>
{% endfor %}
{% else %}
<div{{ attributes.addClass(classes) }}>
<div class="p-012__row">
{% for item in items %}
{{ item.content }}
{% endfor %}
</div>
</div>
{% endif %}
{# output other kinds of fields as default #}
{% elseif field_name == 'field_p_button' %}
{% include '@atoms/06-buttons/_button--field.twig' %}
{% else %}
{% include '@atoms/_field.twig' %}
{% endif %}
