How can I use tag filtering to populate a collection object in Liquid?

Shopify Partner
18 0 1

using Tag Filtering, how would I populate a collection object in liquid? For example, say we have a related tag we're using lets say related-baseball-hats using I can see them all in search. But if I have a product and I pull the tag out, how can I bring back these related products into a collection to show on the product page. Is it possible to use liquid to return a collection based on tag filtering? What is the correct markup.



I was hoping something like this would work?



{% assign my_tagged_products = collection.products | where: "tags", "related-baseball-hats" %}


Replies 0 (0)