templates/includes/details.html.twig line 1

Open in your IDE?
  1. {% set attributes = [] %}
  2. {% if class|default('') != '' %}
  3.     {% set attributes = attributes|merge(['class="details ' ~ class ~ '"']) %}
  4. {% else %}
  5.     {% set attributes = attributes|merge(['class="details"']) %}
  6. {% endif %}
  7. {% if id|default('') != '' %}
  8.     {% set attributes = attributes|merge(['id="' ~ id ~ '"']) %}
  9. {% endif %}
  10. {% if open|default(false) %}
  11.     {% set attributes = attributes|merge(['open']) %}
  12. {% endif %}
  13. <details {{ attributes|join(' ')|raw }}>
  14.     <summary class="details__summary">
  15.         <h2 class="details__heading">{% block summary %}{{ summary|default('') }}{% endblock %}</h2>
  16.     </summary>
  17.     <div class="details__body">
  18.         {% block body %}
  19.         {% endblock %}
  20.     </div>
  21. </details>