You are here

details.html.twig in Zircon Profile 8.0

Theme override for a details element.

Available variables

  • attributes: A list of HTML attributes for the details element.
  • errors: (optional) Any errors for this details element, may not be set.
  • title: (optional) The title of the element, may not be set.
  • description: (optional) The description of the element, may not be set.
  • children: (optional) The children of the element, may not be set.
  • value: (optional) The value of the element, may not be set.

File

core/themes/classy/templates/form/details.html.twig
View source
  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. {%- if title -%}
  19. <summary{{ summary_attributes }}>{{ title }}</summary>
  20. {%- endif -%}
  21. <div class="details-wrapper">
  22. {% if errors %}
  23. <div class="form-item--error-message">
  24. <strong>{{ errors }}</strong>
  25. </div>
  26. {% endif %}
  27. {%- if description -%}
  28. <div class="details-description">{{ description }}</div>
  29. {%- endif -%}
  30. {%- if children -%}
  31. {{ children }}
  32. {%- endif -%}
  33. {%- if value -%}
  34. {{ value }}
  35. {%- endif -%}
  36. </div>
  37. </details>