-
-
Save mherchel/57533351d9efdb2905ec106b2a007421 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{# field--details.html.twig #} | |
{% | |
set classes = [ | |
'details-item', | |
'details-item-' ~ field_name|clean_class, | |
] | |
%} | |
<details{{ attributes.addClass(classes) }}> | |
<summary{{ title_attributes }}>{{ label }}</summary> | |
<div class="details-item__content"> | |
{% for item in items %} | |
<div{{ item.attributes.addClass('details-item__content-item') }}>{{ item.content }}</div> | |
{% endfor %} | |
</div> | |
</details> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{{ content.field_items|add_suggestion(‘details’)|setAttribute('open', 'open') }} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment