A space to discuss online store customization, theme development, and Liquid templating.
The documentation: https://shopify.dev/docs/api/liquid/objects/paginate
This suggests that multiple paginations will provide different `page_params` but this doesn't seem to be the case unless the list itself is directly the setting, which collections would not be, as the list is `products` and not the setting itself.
How would one paginate over multiple collections at one time without having them all squash eachother?
Hi Thekwoka,
The behavior you've described from the `paginate.page_param` documentation is specific to paginating over arrays defined in settings or metafield list types, which is a bit different from paginating over collections. When it comes to paginating multiple collections, unfortunately, the current Shopify Liquid object doesn't inherently support multiple pagination schemes on the same page.
You could explore using custom URL parameters for this situation so instead of relying solely on the default page parameter, use custom parameters for each collection. For example, for a "Men's Shoes" collection, you could use `mens_shoes_page` as the parameter, and for a "Women's Shoes" collection, you could use `womens_shoes_page`.
It could end up looking something like this:
{% paginate mens_shoes.products by 10 as mens_products %}
<!-- Display mens_products here -->
<!-- For pagination links, use the custom parameter: mens_shoes_page -->
{% endpaginate %}
{% paginate womens_shoes.products by 10 as womens_products %}
<!-- Display womens_products here -->
<!-- For pagination links, use the custom parameter: womens_shoes_page -->
{% endpaginate %}
It's also worth noting too that when generating pagination links, you'd need to ensure that you're using the custom parameters.
Hope this helps!
Liam | Developer Advocate @ Shopify
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog