A
A
Artem Shishkov2019-04-26 21:57:27
Jinja
Artem Shishkov, 2019-04-26 21:57:27

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

1 answer(s)
S
Sergey Gornostaev, 2019-04-27
@Combot

<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 question

Ask a Question

731 491 924 answers to any question