Skip to content

Instantly share code, notes, and snippets.

@asmedrano
Created April 22, 2012 19:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save asmedrano/2466271 to your computer and use it in GitHub Desktop.
Save asmedrano/2466271 to your computer and use it in GitHub Desktop.
New Twitter Bootstrap row every Nth item.
{%for item in items%}
{% if forloop.first or forloop.counter0|divisibleby:3 %}
<div class = "row">
{%endif%}
{# We need to add a new Bootstrap row every after every third item item#}
<div class = "span4">
<h3><a href ="">{{title}}</a></h3>
<span>Posted on {{created_on}} </span>
</div>
{% if forloop.last or forloop.counter|divisibleby:3 %}
{#close it out#}
</div>
{%endif%}
{%endfor%}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment