Need to Hide Collection in Dawn Theme

Good day,

I want to hide some specific collections from a particular collection list but i also want the hidden collection to still be visible in the online store and accessible through URL.

Here’s the link: https://www.ottawadivinushair.com/collections

So basically, I want services like "Extras" and "Men" to be hidden in the Women category because they already have their own category.

Thank you.

Hi @Divinus

To hide specific collections from a particular collection list in Shopify while still keeping them visible and accessible via direct URLs, you can use Liquid code to selectively filter which collections appear in the list on the “Women” category page.

Here’s how to do it:

  1. Edit the Collection List Template:
  • In your Shopify Admin, go to Online Store > Themes.
  • Click on Actions > Edit Code for your theme.
  • In the theme files, look for the file where the collection list is displayed. This is usually collection.liquid, collection-list.liquid, or within a section like list-collections.liquid.1. Modify the Liquid Code:

Locate the loop that displays the collections, which often looks like this:

{% for collection in collections %}

{% endfor %}

Add a condition to exclude specific collections (such as “Extras” and “Men”) from the “Women” category. You can do this by using the collection handle. Replace extras and men with the actual handles of those collections.

{% for collection in collections %}

{% unless collection.handle == ‘extras’ or collection.handle == ‘men’ %}

{% endunless %}

{% endfor %}

  • This code uses {% unless %}, which works like “if not,” to exclude those collections from being displayed.
  1. Save and Check Your Changes:
  • After adding the condition, save the changes.
  • Go to your store and navigate to the Women category page to verify that “Extras” and “Men” collections are hidden from this specific list.

Important Notes:- This solution only hides collections on this specific page where you added the condition. The hidden collections will still be accessible on the online store via direct URL or through other menus/categories where they are displayed.

  • Customizing visibility: If you have multiple collection lists or specific collection pages where you want this behavior, you may need to add this condition in other places as well.

Let me know if you’d like further guidance on finding your collection handles or if you encounter any issues!

Best regards,
Daisy