daily pastebin goal
23%
SHARE
TWEET

Untitled

a guest Mar 13th, 2018 58 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. {# Assuming a page object with one or more instances of a content block: #}
  2. {% for block in page.blocks %}
  3.     {# Start a new row every third block. #}
  4.     {% cycle '<div class="row">' "" "" %}
  5.         <div class="col-md-4">
  6.             {{ block }}
  7.         </div>
  8.     {# End every third row. #}
  9.     {% cycle "" "" '</div>' %}
  10. {% endfor %}
  11.  
  12. {# The row div will need to be closed if the total blocks is no divisible by 3. #}    
  13. {% if not page.blocks|length|divisibleby:"3" %}</div>{% endif %}
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top