0

i got these code

`{%for number in List %}
        <div class="top">
              <h3>
                <a href="/my-blog-post">{{songs.history.0.Song}}</a>
              </h3>
            <section>
              <p>{{number}}Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec viverra nec nulla vitae mollis.</p>
            </section>
            <footer>
              <small>
                Posted on <time datetime="2017-04-29T19:00">Apr 29</time> in <a href="/category/code">Code</a>
              </small>
            </footer>
        </div>

i want that the number of the {{songs.history.0.Song}} change with the var of the loop but when i change it to {{songs.history.number.Song}} the element a dont appear

the thing is that i want that the number change automatic

1 Answers1

-1

Something like:

{% for song in songs.history %}
<div> Number: {{loop.index}} </div>
<div> Name: {{song.Song}} </div>
{% endfor %}
Daniel
  • 3,228
  • 1
  • 7
  • 23