Answer the question
In order to leave comments, you need to log in
How to take part of an array?
I have an array in which the first element is the name of the category, the rest are the objects themselves that are included in this category.
Is there a way to take the first element and then run all the rest with a For?
Answer the question
In order to leave comments, you need to log in
<h1>{{ some_list|first }}</h1>
<ul>
{% for item in some_list[1:] %}
<li>{{ item }}</li>
{% endfor %}
</ul>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question