Created
March 7, 2017 21:12
-
-
Save andy-williams/365af3fdf9e593475d5466dea27bc10b to your computer and use it in GitHub Desktop.
shopify-modulo
This file contains hidden or 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
{% for product in collection.products %} | |
{% capture everyThird %}{{ forloop.index | modulo: 3 }}{% endcapture %} | |
{% capture everyOnePastThird %}{{ forloop.index0 | modulo: 3 }}{% endcapture %} | |
{% if forloop.first == true or everyOnePastThird == '0' %} | |
<div class="row"> | |
{% endif %} | |
{% include 'product-catalog-item' %} | |
{% if forloop.last == true or everyThird == '0' %} | |
</div> | |
{% endif %} | |
{% endfor %} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment