Different filters displayed per product type/collection - is it possible?

Hey all! I’m a bit new to Shopify, and while a former coder, I’m knocking the dust off of slowly figuring out the framework.

I’m currently using the Dawn theme, and the free Search and Filter App. I’m curious how/if different filters can be displayed based on the product collection page a customer is on. For example - if I have a collection of ‘fantasy’ figures, I may want a filter to show role (e.g. wizard, bard, barbarian, etc). If a customer is on a different collection page, I may not use the field of ‘role’ at all, or use it with completely different attributes (Hero Unit, Medic, etc).

At present, I’ve developed metafields, to me it seems that they are easier to manage than tags (I prefer key=value pairs). I have also created sub-collection pages, and I’ve also developed a filter based upon the metafields that should be displayed.

The challenge I’ve run into is that I cannot find a way to display different fields/filters per collection page. I did notice that products with null values, or those not matching the subcollection criteria do not show up, but this isn’t necessarily what I want.

Alternatively, a second vertical menu on the side would work as well. Am I crazy or do I have the wrong approach in thinking about this?

You have some helpful documentation here about how to do storefront filtering the right way. I believe most important resources and objects are listed there (filter object etc.) so I won’t go in more details.

If you want to play around with an existing filtering system, you can download a fresh Dawn theme and mess around with the code in the facets.liquid file, it should accelerate your process, it’s simple and effective, you could practically use it as a boilerplate code for your project, with little to no adjustments.

You should also downlaod the Search & Discovery app to toggle the options/metafields you wanna enable in the filters.

And finally, if for instance, a filter is not needed for any product in a collection page, then it should not be displayed at all, which is the expected behaviour since this filter can’t do anything. So if you wanna have it appear at all time, you’d have to find a custom alternative (list all your filters in a metaobject for instance).

Thanks Max! I’m going to look into it - I had no idea it was called ‘storefront filtering’, that will get me on my way!!