Hi. There are a lot of threads about this, and they all seem to just be shut down by the admins, so I'd like to try again:
Sorting Collections by anything other than the standard methods seems impossible. I want to sort my collections by dates — dates of my choosing. So I assign the product a date and the collection sorts that way. I thought the publish date would be a good place to start, but....
SO! Anyone got an idea how I can automatically resort the front end of my collections by dates that I assign to the products?
Hello Ben, Ben here - your Shopify Guru!
You could always manually sort your collection listings using a link list. There is a guide here on how to do that:
If you reorder the links in the list it will reflect on the front end.
If that does not work for you then you would need to program some sort of custom sort. LIquid on it's own cannot do this, you can't set a publish date with collections either. I would suggest you use metafields to add your post date to the collection. Set up a namespace like:
date => posted : value
That is where the easy part of this ends. You then would need to build a json string to hold all your collection objects. But by default liquid will not return your metafields with the collection object. So you would need to manually open the json object text string. Then insert your metafield as part of the object. Do this for each collection you have attached your metafield too. This could be within an alternative list-collections.liquid template. Something like the code I have here:
I hope this helps! Feel free to reach out if you have any further questions :)
Ben C - Shopify Guru
Hello there, We just added a feature to sort your existing collections by either updated or publish date to our app Advanced Collections - https://apps.shopify.com/advanced-custom-collections
For this issue, you can try sorting by publish date as you can edit the publish date on Shopify admin itself. There is a 7 day free trial so do try it out. Thanks!