{# /** * @file * Default theme implementation 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. * * @see template_preprocess_fieldset() * * @ingroup themeable */ #} {% set classes = [ 'js-form-item', 'form-item', 'js-form-wrapper', 'form-wrapper', ] %}
{% set legend_span_classes = [ 'fieldset-legend', required ? 'js-form-required', required ? 'form-required', ] %} {# Always wrap fieldset legends in a
for CSS positioning. #}
{{ legend.title }}
{% if description_display == 'before' and description.content %}
{{ description.content }}
{% endif %} {% if errors %}
{{ errors }}
{% endif %} {% if prefix %}
{{ prefix }}
{% endif %} {{ children }} {% if suffix %}
{{ suffix }}
{% endif %} {% if description_display in ['after', 'invisible'] and description.content %}
{{ description.content }} {% endif %}