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
Starting a B2B store is a big undertaking that requires careful planning and execution. W...
By JasonH Sep 23, 2024By investing 30 minutes of your time, you can unlock the potential for increased sales,...
By Jacqui Sep 11, 2024We appreciate the diverse ways you participate in and engage with the Shopify Communi...
By JasonH Sep 9, 2024