How can I add classes to rows depending on the loop index? I have received a design where they want to have the latest three articles links put on the top of the front page (over their respective images) so that the first is taking left half of the page and second and third to split (vertically) the right half top.
I thought that view-view--latest-articles.html.twig would solve the problem elegantly like this:
&lt;div class=&quot;row&quot;&gt;
{% for row in rows %}       
    {% if loop.index == 1 %}
      &lt;div class=&quot;col-6&quot;&gt;
          {{ row }}
      &lt;/div&gt;
    {% elseif loop.index==2 %}
    ...   // dull and inelegant code dismissed
    {% endif %}
{% endfor %}

But if I put debugging code for loop.index into the code it only shows the index once and splurts out all the rows after it, never minding my if. It still shows the index once, so I know it IS using the template.
Am I missing something or trying just to it in a wrong way?
And as it so often happens:
Just after fighting a pair of hours with this and then finally asking the question here, I found out the solution myself. I had to make the code in views-view-unformatted--latest-articles.html.twig (i.e. had to add the -unformatted to my question part).