{# /** * @file * Theme override for a fieldset element and its children. * * Available variables: * - attributes: HTML attributes for the
element. * - errors: (optional) Any errors for this
element, may not be set. * - required: Boolean indicating whether the
element is required. * - legend: The element containing the following properties: * - title: Title of the
, intended for use as the text of the . * - attributes: HTML attributes to apply to the element. * - description: The description element containing the following properties: * - content: The description content of the
. * - attributes: HTML attributes to apply to the description container. * - description_display: Description display setting. It can have these values: * - before: The description is output before the element. * - after: The description is output after the element (default). * - invisible: The description is output after the element, hidden visually * but available to screen readers. * - children: The rendered child elements of the
. * - prefix: The content to add before the
children. * - suffix: The content to add after the
children. * - title_display: Title display setting. * - inline_items: Boolean indicating whether the
items are inline. * * @see template_preprocess_fieldset() * @see olivera_preprocess_fieldset() */ #} {% set classes = [ 'fieldset', attributes.hasClass('fieldgroup') ? 'fieldset--group', 'js-form-item', 'form-item', 'js-form-wrapper', 'form-wrapper', ] %} {% set wrapper_classes = [ 'fieldset__wrapper', attributes.hasClass('fieldgroup') ? 'fieldset__wrapper--group', ] %} {% set legend_span_classes = [ 'fieldset__label', attributes.hasClass('fieldgroup') ? 'fieldset__label--group', required ? 'js-form-required', required ? 'form-required', ] %} {% set legend_classes = [ 'fieldset__legend', attributes.hasClass('fieldgroup') and not attributes.hasClass('form-composite') ? 'fieldset__legend--group', attributes.hasClass('form-composite') ? 'fieldset__legend--composite', title_display == 'invisible' ? 'fieldset__legend--invisible' : 'fieldset__legend--visible', ] %} {% set description_classes = [ 'fieldset__description', ] %} {# Always wrap fieldset legends in a for CSS positioning. #} {% if legend.title %} {{ legend.title }} {% endif %} {% if inline_items %}
{% endif %} {% if description_display == 'before' and description.content %} {{ description.content }}
{% endif %} {% if prefix %} {{ prefix }} {% endif %} {{ children }} {% if suffix %} {{ suffix }} {% endif %} {% if errors %}
{{ errors }}
{% endif %} {% if description_display in ['after', 'invisible'] and description.content %} {{ description.content }} {% endif %} {% if inline_items %} {% endif %}