Hi everyone,
I’m trying to figure out how to get access to the values of a field that can contain multiple values in order to rewrite them in a view.
I have a content type which has two fields that can contain multiple values :
- Position
- Start/End date
I created a view with the following settings :
- Format : Unformatted list
- Show : Fields
Inside this view, i set a bunch of field that are hidden and rewrite the result using the replacement patterns in the last field. There i mix HTML + Twig in order to get the correct rendering.
The thing i don’t get is how to access each individual values of the field Position and Start/End date. I tried to use some loop to get through the value index of these fields but didn’t manage.
Here is a snippet of what i’m trying to accomplish :
<div class="wrapper-img-cards">
<a href={{ view_node }}>
{{ field_image_management}}
</a>
</div>
<div class="wrapper-data-cards">
<a href={{ view_node }}>
<h3>{{ title }}</h3>
</a>
<div class="wrapper-subtitle-cards">
<!-- Here is where i want to loop through the values -->
<p>{{ field_position }} | {{ field_starting_date_ending_date }}</p>
</div>
</div>
Many thanks
Maxime