details.html.twig 951 B

12345678910111213141516171819202122232425262728293031323334353637
  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. {% if errors %}
  28. <div>
  29. {{ errors }}
  30. </div>
  31. {% endif %}
  32. {{ description }}
  33. {{ children }}
  34. {{ value }}
  35. </details>