views:

61

answers:

2
{% for p in profiles %}
<div class="result">
    {{ p.first_name }}
</div>
{% endfor %}

Suppose I have 1000 of these, in a huge list. How would I make this code appear every 15 times?

<div class="menu">abc</div>
+1  A: 

You can use the forloop.counter value with a divisibleby filter in an if condition. See the documentation here

Eli Bendersky
+2  A: 

Use the forloop.counter variable with divisbleby filter.

{% if forloop.counter|divisbleby:"15" %}
    <div class="menu">abc</div>
{% endif %}
stefanw