Is there a way to iterate custom arrays with paginate tag?

Is there a way to iterate custom arrays with paginate tag?

doğukan
Shopify Partner
4 0 0

I'm iterating all blog posts and filter them by metafields.

article.metafields.accentuate.languages

Something like

{% assign totalList = '' %}

{% if article.metafields.accentuate.languages contains 'tr' %}
  {%- capture item -%}
    <div>{{ article.title }}</div>
  {% endcapture %}
  {% assign totalList = item | append: '|' | append: totalList %}
{% endif %}

{% assign totalListArr = totalList | split: '|' %}

So I can iterate totalListArr with a for loop. But I need to do it with the paginate tag. When I do this:

{% paginate totalListArr by 15 %}
  ....
{% endpaginate %}

it gives "Array 'totalListArr' is not paginateable." error. Is there a way to paginate this array?

Replies 0 (0)