You are here

field-group-accordion-item.html.twig in Field Group 8.3

Same filename and directory in other branches
  1. 8 templates/field-group-accordion-item.html.twig

Default theme implementation for a fieldgroup accordion item.

Available variables:

  • title: Title of the group.
  • children: The children of the group.
  • label_attributes: A list of HTML attributes for the label.
  • attributes: A list of HTML attributes for the group wrapper.

File

templates/field-group-accordion-item.html.twig
View source
  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>