Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {# Assuming a page object with one or more instances of a content block: #}
- {% for block in page.blocks %}
- {# Start a new row every third block. #}
- {% cycle '<div class="row">' "" "" %}
- <div class="col-md-4">
- {{ block }}
- </div>
- {# End every third row. #}
- {% cycle "" "" '</div>' %}
- {% endfor %}
- {# The row div will need to be closed if the total blocks is no divisible by 3. #}
- {% if not page.blocks|length|divisibleby:"3" %}</div>{% endif %}
Add Comment
Please, Sign In to add comment