Answer the question
In order to leave comments, you need to log in
How to make next element from array in another block?
There is an enumeration by the for loop from the data array.
{% for x in list %}
<div class="col-md-4">
{% if x.image %}
<div class="fh5co-grid animate-box" style="background-image: url({{ x.image.url }});">
<a class="image-popup text-center" href="{{ x.get_absolute_url }}">
<div class="work-title">
<h3>{{ x.title }}</h3>
<span>{{ x.category }}</span>
</div>
</a>
</div>
{% endif %}
</div>
{% endfor %}
Answer the question
In order to leave comments, you need to log in
https://djbook.ru/rel1.9/ref/templates/builtins.ht... - you can use additional for loop variables - counter, revcounter, etc.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question