field-group-accordion-item.html.twig 813 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. {#
  2. /**
  3. * @file
  4. * Default theme implementation for a fieldgroup accordion item.
  5. *
  6. * Available variables:
  7. * - title: Title of the group.
  8. * - children: The children of the group.
  9. * - label_attributes: A list of HTML attributes for the label.
  10. * - attributes: A list of HTML attributes for the group wrapper.
  11. *
  12. * @see template_preprocess_field_group_accordion()
  13. *
  14. * @ingroup themeable
  15. */
  16. #}
  17. {%
  18. set label_classes = [
  19. 'field-group-format-toggler',
  20. 'accordion-item',
  21. open ? 'field-group-accordion-active',
  22. ]
  23. %}
  24. {%
  25. set classes = [
  26. 'field-group-format-wrapper',
  27. ]
  28. %}
  29. <h3 {{ label_attributes.addClass(label_classes) }}>
  30. <a href="#">{{ title }}</a>
  31. </h3>
  32. <div {{ attributes.addClass(classes) }}>
  33. {% if description %}<div class="description"></div>{% endif %}
  34. {{children}}
  35. </div>