Liquid, JavaScript, themes, sales channels
Hi,
I use
{% for collection in collections reversed%}
{% if collection.image and collection.title contains "ABC" %}
<div> output do something for each collection containing ABC </div>
to get a subset of collections matching the criteria.This worked fine until the total Nr. of collections grew ++ 1000+++ in the collections list only 1000 are contained (or the loop stops after 1000 i don't know which). Unfortunately the "reversed" parameter does not give me the "latest" (newest) collections; the cutoff seems to be done before reversed is applied.
The result is - I don't get a complete list of my ABC collections.
in the documentation here: https://shopify.dev/docs/themes/liquid/reference/objects#collections I find nothing about the cutoff after 1000 collections
Any help much appreciated.
The wanted output is a list of collections images with links to the collections:
https://mode-erleben.at/pages/empfehlung
every collection is an "outfit" - a bundle of manually selected items.
Is there a way to filter BEFORE the loop starts?
Is there a way to filter BEFORE the loop starts?
No.
find nothing about the cutoff after 1000 collections
The maximum number of items you'll get in any Liquid= Drop will be 1000 items.
I don't see doing this in Liquid as an efficient method. Especially if you have well over 1000 collections to try and sort/filter.
A JavaScript (with AJAX) approach is likely going to get better, as would something that uses Menus (linklists). At least with a menu you can easily define what collection is part of the group and change the order in which they show quite easily.
Are you ready to take your business to the next level? Look no further than the latest ...
By SarahF_Shopify Apr 15, 2024We’re keeping the ball rolling to make sure you’re always ahead of the game. So buckle ...
By JasonH Apr 8, 2024Portrait of Stephen positioned next to an image of planet Earth, with the Stephen's World ...
By JasonH Mar 18, 2024