We have an array of objects that need to be displayed.
{% for item in items %} <li></li> {% endfor %} Also the item can be active
{% for item in items %} <li class="{% if smth == smth2 %}active{% endif %}"></li> {% endfor %} Since the element can be many, and the block is limited in height, an internal scroll is required, but the active element can be lost in this footcloth, so you need to display it as the first element
{% for item in items %} {% if smth == smth2 %} {% if loop.index == 1 %} <li class="active"></li> {% endif %} {% else %} <li></li> {% endif %} {% endfor %} This is all I have come to, but it does not work.