Need to add dynamic class in li element of below code like dymanic democlass1,democlass2...... so-on in loop.

 <div class="rrssb">
 {% if prefix_text %}
 <div class="rrssb-prefix">{{ prefix_text }}</div>
 {% endif %}
 <ul class="rrssb-buttons">
{% for button in buttons %}
  <li class="rrssb-{{ button.name }}">
    <a href="{{ button.link }}" {{ button.class | raw }}>
      <span class="rrssb-icon">{{ button.svg | raw }}</span>
      <span class="rrssb-text">{{ button.text }}</span>
{% endfor %}

1 Answer 1


You can use

{{ loop.index }}

this will count up each time it goes through the loop

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.