Displaying a specific collection in Shopify
Hi I'm coding a psd to be a Shopify theme. The actual shop is supposed to have several collections of products. I've also new to shopify.
Here's what I'm not sure about. I'll have a top nav listing the various collections....women's dresses, Men's shirts etc. but what's the best coding practice or technique to ensure the right collections get's displayed on the single collections page (collections.liquid) when the user clicks through each time.
This demo achieves what I'm explaining and I've downloaded the theme and studied the source code but still don't really understand.
(click the category links in the left hand nav and the one page display the relevant collection each time)
I was hoping someone could explain in simple terms the coding process.
This is done for you automatically. Shopify will pick up on the collection specified in the url (e.g.
blah.myshopify.com/collections/hello) and drop that collection (
hello in our example) into the
collection liquid variable. You can then access the products using
collection.products in the template
Here's the relevant documentation (A bit sparse, I'll admit) showing you the variables that are available within the
collection.liquid template: http://wiki.shopify.com/Collection.liquid (http://wiki.shopify.com/Collection.liquid)
/collections path is using
list-collection.liquid template, if you want to change the default behavior, then edit that file.
By default it shows all collections from shop, it can be as automatic collections and as the manual created ones.
Didn't find the answer?
Our community is visited by hundreds of Shopify development professionals every day. Ask your question and get a quick answer for free.
Find the answer in similar questions on our website.
Write quick answer
Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.