Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save carolineschnapp/523455 to your computer and use it in GitHub Desktop.
Save carolineschnapp/523455 to your computer and use it in GitHub Desktop.
Listing all collections in the shop
@schaeken
Copy link

schaeken commented Dec 4, 2014

Can we replace line 33 with this:

{% if collection.image %}
            {{ collection.image.src | collection_img_url: 'medium' | img_tag: collection_title }}{% else %}
            {{ collection.products.first.featured_image | product_img_url: 'medium' | img_tag: collection_title }}
{% endif %}

@jeicob
Copy link

jeicob commented Dec 14, 2014

Hello, how are you? I am new in shopify and wanted to organize the order of our collections and we have been told to use this code, but we have no idea even where to paste it or what to do afterwords, any help?

@MegiMoo
Copy link

MegiMoo commented Feb 24, 2015

I would like to get help with our collections too.. jeicob did you get an answer?

@Ubrwgn
Copy link

Ubrwgn commented Feb 28, 2015

I've been working on a tutorial, http://www.tetchi.ca/shopify-theme-from-scratch/, and although it's not quite up to date, it's fairly easy to follow. However, I simply cannot get my /collections page to show up when I click on Catalog in the main menu. I want my customers to be able to pick which collection (category) of products they wish to inspect. I failed at getting a drop down menu to work also.
This github page was recommended to solve the problem of managing collections.
Maybe the code above goes in the list-collections.liquid file we made in the tutorial. That is just a wild guess. I'm afraid I'm just as lost as before. Anyone want to reach out and help us? Please?

@celined
Copy link

celined commented Mar 19, 2015

Hi @jeicob, @MegiMoo and @Ubrwgn,
The code above does indeed go into the list-collections.liquid file
I just tried it out and it works perfectly. All I did was replace my existing code in list-collections.liquid with the above (note that you may need to tweak/remove the ul, li and h2/h3 tags to match your site's style).

Once the file is saved, go to 'Navigation' and add a new link list and name it 'Featured collections' and save it. You can then add the collection links and re-order them as needed. Hope this helps!

@rando1201
Copy link

This still isnt working for me.

@michael82605
Copy link

I've pasted the code in, created the link list and added it to the navigation. However, when I click on Featured collections on the navigation bar on my store, it brings me to /collections and shows all my collections in alphabetical order (basically the default). What am I missing here?
Also, isn't there a way to name the collection other than "Featured collections"? And can this functionality be applied to several collections? The goal here being to create a Shoes collection and a Pants collection for instance.

Thanks in advance.

@paulmist
Copy link

Am I correct in thinking there's no way to paginate the out put of the link list method?

@Hashmi898
Copy link

Hashmi898 commented Jul 10, 2020

thanks

@subhashgit
Copy link

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment