Shopify themes, liquid, logos, and UX
I have a metafield 'subcollection' that accepts a list of collection. On one of the collection pages, I have 124 'subcollections', but it only returns 50. What's the solution or work around for this?
<ol> {% for col in collection.metafields.custom.subcollections.value %} {% if col != blank %} <li>{{ col.title }}</li> {% endif %} {% endfor %} </ol>
@stressedowner hope you are well,
can you please try with this code
{% assign subcollections = collection.metafields.custom.subcollections.value | split: ',' %}
{% assign page_size = 50 %}
{% assign total_pages = subcollections.size | divided_by: page_size | ceil %}
{% for page in (1..total_pages) %}
<h3>Page {{ page }}</h3>
<ol>
{% assign start_index = page_size | times: page | minus: page_size %}
{% assign end_index = start_index | plus: page_size %}
{% assign current_page_subcollections = subcollections | slice: start_index, page_size %}
{% for col_handle in current_page_subcollections %}
{% assign col = collections[col_handle] %}
{% if col %}
<li>{{ col.title }}</li>
{% endif %}
{% endfor %}
</ol>
{% endfor %}
hope its work for you with paginations
thank you
It didn't work.
I tried printing out the values of subcollections and its size.
subcollections value is CollectionDropList
subcollection.size is 1
Discover how to increase the efficiency of commerce operations with Shopify Academy's l...
By Jacqui Mar 26, 2025Shopify and our financial partners regularly review and update verification requiremen...
By Jacqui Mar 14, 2025Unlock the potential of marketing on your business growth with Shopify Academy's late...
By Shopify Mar 12, 2025