Context:
I have 10-ish collections with a metafield “is_artist” set true. These collections are for artists who can have a description, featured image and their products in one spot. This number will likely grow over a 100. I’m trying to build an artist-overview page where these collections are rendered and paginated by 15.
Latest attempt:
Filtering works with an if, but then the pagination breaks ( empty pages since not every collection has this metafield set true). See pictures below.
Below is my latest attempt (note: I’m new to liquid/shopify developing). Maybe I’m looking in the wrong direction and there is a much better approach to this, please let me know if this is the case.
{% paginate collections | where: collection.metafields.custom.is_artist, true by 15 -%}
{%- for collection in collections %}
{% if collection.metafields.custom.is_artist == true %}
<h2>{{ collection.title }}</h2>
{%- endif -%}
{% endfor %}
{{ paginate | default_pagination: next: 'Older', previous: 'Newer' }}
{% endpaginate %}
The above example will filter & paginate the content but will have empty pages since the pagination pages all the collections;