Search code examples
shopifycycle

Shopify closing cyle-tag


I'm trying to achieve to close an cycle-tag after an iteration over a collection has finished.

<div class="row products">
    {% for product in collection.products limit: settings.pagination_limit %}
    {% cycle '<div class="row">', '', '', '' %}
    {% include 'product-loop' with collection.handle %}
    {% cycle '', '', '', '</div>' %}
    {% endfor %}
  </div>

I know about using cycling groups, but I don't know how to use it here. After iterating over a collection a new cycling group should be used.

I tried using this what isn't working:

{% cycle [collection.handle]: '<div class="row">', '', '', '' %}

Do you have any ideas?


Solution

  • It should work without the square brackets. Try this:

    {% cycle collection.handle: '<div class="row">', '', '', '' %}