Version 1
[yaffs-website] / web / core / themes / stable / templates / form / details.html.twig
1 {#
2 /**
3  * @file
4  * Theme override for a details element.
5  *
6  * Available variables
7  * - attributes: A list of HTML attributes for the details element.
8  * - errors: (optional) Any errors for this details element, may not be set.
9  * - title: (optional) The title of the element, may not be set.
10  * - description: (optional) The description of the element, may not be set.
11  * - children: (optional) The children of the element, may not be set.
12  * - value: (optional) The value of the element, may not be set.
13  *
14  * @see template_preprocess_details()
15  */
16 #}
17 <details{{ attributes }}>
18   {%
19     set summary_classes = [
20       required ? 'js-form-required',
21       required ? 'form-required',
22     ]
23   %}
24   {%- if title -%}
25     <summary{{ summary_attributes.addClass(summary_classes) }}>{{ title }}</summary>
26   {%- endif -%}
27
28   {% if errors %}
29     <div>
30       {{ errors }}
31     </div>
32   {% endif %}
33
34   {{ description }}
35   {{ children }}
36   {{ value }}
37 </details>