Created
November 21, 2013 21:35
-
-
Save stewartknapman/7590121 to your computer and use it in GitHub Desktop.
Shopify Liquid template that wraps looped items in a row on every third or fourth iteration.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% assign thumbs_per_row = settings.thumbnails-per-row | times:1 %} | |
{% if forloop.length > thumbs_per_row %} | |
{% assign mod = forloop.index | modulo:thumbs_per_row %} | |
{% if mod == 0 %}</div><div class="row">{% endif %} | |
{% endif %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="row"> | |
{% for item in loop %} | |
{% include '_item' with item %} | |
{% include '_end_row' %} | |
{% endfor %} | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment