Let’s say I have a custom metafield named “Brand” with single text field type and I have the Shopify Search & Discover app configured to let users filter by this Brand field. I want to make a “Brands” page that lists all the brands entered on products. The brands would link to filter result URLs.
I haven’t been able to figure out how to use Liquid to loop through filter options. Here’s my filter sidebar. I want to mimic that list of brands but on a page as links.
Hi @stormeagle
Roughly do a filter loop and just check if it’s a specific name e.g. “filter.label” or some other property of the filter object.
Start at first principles
https://shopify.dev/docs/storefronts/themes/navigation-search/filtering/storefront-filtering
Create a minimal reproducible example https://stackoverflow.com/help/minimal-reproducible-example
of only the relevant logic as otherwise filtering code can be very long an verbose making it larger chore for others to try and help.
If you don’t want to be a web developer and just need this customization then contact me for services
Contact info in forum signature.
ALWAYS please provide context, examples: store url, theme name, post url(s) , or any further detail in ALL correspondence.
Good Hunting.
Thank you for the guidance.
I see now that the filters object is available only on collections and search. I want to make an index of filter values on a page using a Liquid widget in a page template. I’m able to loop all products to get values (and count) for a metafield like Brand but that’s really not performant and has a 1,000 product limit anyhow. Guess I’d need to develop an app to accomplish this outside of Shopify’s environment.
https://shopify.dev/docs/api/liquid/objects/filter