I'm using the field collection module in Drupal 8 to encapsulate event informations so I've got a field collection with six sub fields (place, starting time, etc.).
In my twig template field--field-event.html.twig
, I'd like to extract each item of the field collection and bring it separately to the view - but I can't figure it out. What's the right way to get the content of each field collection item and process it individually?
{% for item in items %}
{{ kint(item) }}
{% endfor %}
Iterating through the field collection with above code gives me an impression that the field collection items have got a content (with #markup
) and attributes but how do I get to the core/values of the field items?
FieldItem
- Store data,Widget
- Configure data (when you create a field from UI),Formatter
- Create a render element and displays data (here you can define some options to how to display too).