{% for item in items %} {% if loop.index is divisibleby(2) %} <div class="clearfix"></div> {% endif %} {% endfor %}