In Drupal 8, I have a content type which use Field Collection Module like that :
field_body
(FieldCollection, repeatable)field_image_alignment
(Boolean)field_picture
(Image)field_free_text
(Long Text)
I want to theme this fields.
I overrided the field template with a file named field--node--field-body--news.html
(news is the content type that contains theses fields.).
Default template is this :
{% for item in items %}
<div{{ item.attributes }}>{{ item.content }}</div>
{% endfor %}
And my template overrided is like that :
{% for item in items %}
{% if item.content['#field_collection_item'].field_image_alignment.value == 1 %}
{{ dump(item.content['#field_collection_item'].field_picture) }}
{% endif %}
{% endfor %}
How can I render "child" fields field_pictures
, field_free_text
?
I used item.content['#field_collection_item'].field_image_alignment.value
to access to the plain value but I would like to have the rendered view.
Thanks a lot.