I am trying to implement a carousel , inside my views-view-fields--block_1.html.twig , I want to add active class inside the div for the first Iteration . I have added the code in twig file but every time it is adding active class for all the iteration.
code snippet:
{% if fields.counter.content == 1 %}
{% set tag = "active" %}
{% else %}
{% set tag = "" %}
{% endif %}
In my view title,body,image and result counter fields are there . From result counter i am getting the value and comparing inside the above twig file. Can anyone give suggestion, how to achieve this.
Thanks,
{{ fields.counter.content }}
and see what number shows up.