Pipeline theme - display select filters on collection pages

I’m working on Pipeline 8.1 and have created custom product filters using metafields and Search & Discovery. I’d like to display some of these filters on some collections, and not others. For example, I’d like the filter “Sleeve Length” to appear on my “Shirts” collection but not “New Arrivals”. I understand that this may be possible by creating custom templates for each collection and adding a custom metafield with a JSON value for the desired filters to each collection, but I’m not sure how to format/place the conditional logic in the collection file. Thanks in advance for any help with this!

The simplest , but somehow also hardest, way is to not have products in a collection with those characteristics for those filters :scissors: :knot: , :face_exhaling:

Hi @kate_zmc :waving_hand:
Roughly find the filters loop and add a check for the collection and filter label

{%- for filter in collection.filters -%}
  {% if collection.handle == "excluded-collection" and filter.label == "BadFilter" %}
    {% continue %}
  {% endif %}

But for many combinations you’ll need another scheme and different logic if you want to avoid hard coding EVERY set of conditions.
Reach out to me if you need theme customization services.
:speaking_head::postbox: Click profile pic on forums for options to connect directly; please ALWAYS include context in new comms.

If you must DIY start in the dev docs https://shopify.dev/docs/storefronts/themes/navigation-search/filtering
https://shopify.dev/docs/storefronts/themes/navigation-search/filtering/storefront-filtering/support-storefront-filtering ; also research the forums

Really though that’s an advanced theme customization teaching to code is beyond the scope of the forums.
So the question is overly broad without showing your work so far.
As it can vary wildly between themes and any apps being used and the actual logic etc etc etc.

Merchants needing a quick fix should probably pursue a more full featured search/filter apps at a monthly fee that meet business requirements to conditionally control filters in different ways.

1 Like