All things Shopify and commerce
Theme - Supply
Store - kathiemiller
I want to split a collection into sub collections
Main collection - Original Photorealistic ARt
Sub Collection - Birds
Sub Collection - Animals
Main collection - Contemporary Art
Sub collection - Birds
Sub collection - Animals
I have no idea how to do this.
Hi @aart2000
To split your collections into sub-collections using the Supply theme on your Shopify store kathiemiller.com, you can follow these steps:
1. Create the sub-collections:
- In your Shopify admin, go to Products > Collections.
- Click "Create collection" and create a collection for each sub-collection you want, such as "Birds" and "Animals".
- Add the relevant products to each sub-collection.
2. Edit the collection template:
- Go to Online Store > Themes and click "Actions" > "Edit code" on your Supply theme.
- Under "Templates", look for a file called `collection.liquid` and open it.
- Find the section that displays the collection title, usually `{{ collection.title }}`.
- Below that, add the following code to display the sub-collections:
{% for link in linklists[collection.handle].links %}
{% if link.type == 'collection_link' %}
<a href="{{ link.url }}">{{ link.title }}</a>
{% endif %}
{% endfor %}
This code loops through the menu items linked to the current collection and displays them as clickable links if they are sub-collections.
3. Create a nested menu:
- Go to Online Store > Navigation.
- Click "Add menu" and name it something like "Collection Menu".
- Add a link to the main collection, e.g., "Original Photorealistic Art".
- Hover over that menu item, click "Add", and choose "Collection" to add the sub-collections "Birds" and "Animals" nested under it.
- Repeat for the "Contemporary Art" collection and its sub-collections.
- Save the menu.
4. Assign the menu to the collection page:
- Go back to the `collection.liquid` template in your theme code editor.
- Look for a line that includes the menu, e.g., `{% assign main_menu_linklist = linklists[section.settings.main_linklist] %}`.
- Change the menu handle to your newly created "Collection Menu", e.g.:
`{% assign collection_menu = linklists['collection-menu'] %}`
- Save the template file.
Now when you view your main collections "Original Photorealistic Art" and "Contemporary Art", you should see the sub-collections "Birds" and "Animals" displayed as clickable links, allowing customers to filter the products.
This method utilizes Shopify's nested navigation and collection handles to create a hierarchy of collections and sub-collections without requiring complex customizations to your theme.
Let me know if you have any other questions or if you need help.
Was this helpful? Like or Accept solution - Buy me a coffee ☕️
- Contact me: Xipirons | WhatsApp
- Shopify Developer based in France, helping online merchants succeed
Oh my goodness. I'm not very computer savy. This has my head spinning. I would need some help with this. My biggest fear is messing things up and ending up with a total disaster and not being able to get back out. Especially when it comes to the codes. I won't go near them 😱. What would you charge to do it for me?
Hi @aart2000
I send a private message
Was this helpful? Like or Accept solution - Buy me a coffee ☕️
- Contact me: Xipirons | WhatsApp
- Shopify Developer based in France, helping online merchants succeed
Starting a B2B store is a big undertaking that requires careful planning and execution. W...
By JasonH Sep 23, 2024By investing 30 minutes of your time, you can unlock the potential for increased sales,...
By Jacqui Sep 11, 2024We appreciate the diverse ways you participate in and engage with the Shopify Communi...
By JasonH Sep 9, 2024