Hey everyone how would I run a loop on a nested list? For example, lets say I have a parent categories for music genre like "Rock & Roll" , "Country", etc... and then underneath each of those would be artist?
Community guidelines
Please keep discussions civil and on-topic. Repeated violations may lead to a temporary ban.
Themes & Styling
Nest the loops:
TWIG
{% for data as genre %}
{% for genre as subgenre %}
{% for subgrense as artist %}
{{ artist.name }}
{% endfor %}
{% endfor %}
{% endfor %}
Thanks OleVik!
When I first started to work through this I only had 2 "for" loops but it turned out I needed 3 like what you have here. Worked like a charm, thanks!
Log in to reply.
Suggested topics
| Topic | Participants | Replies | Views | Activity |
|---|---|---|---|---|
| 4 | 198 | 2 months ago | ||
| 3 | 94 | 2 months ago | ||
| 11 | 455 | 3 months ago | ||
| 0 | 48 | 3 months ago | ||
| 5 | 128 | 3 months ago |