How do I render a collection description on a product page?
I’ve tried inputting a variable that matches the collection handle:
{{ collection[variable].description }}
This works for pages but not collections.
Thank you.
How do I render a collection description on a product page?
I’ve tried inputting a variable that matches the collection handle:
{{ collection[variable].description }}
This works for pages but not collections.
Thank you.
Hi @SpotterJ
You are pretty close actually (notice the “s” in collections). You can either do:
{{ collections["variable"].description }}
or
{{ collections.variable.description }}
omg, lol.
Thank you so much!
@MaxDesign @SpotterJ Does this need to have the product be within a collection url? The code doesn’t pull through the description for my store on a product page as is. Thanks
@fideas There is no product. This is the collections object: https://shopify.dev/api/liquid/objects#collections and here we asked for the collection’s description. As a result, product description would be {{ product.description }} or {{ all_products[“your-product-handle”].description }}
@MaxDesign sorry I was going by the op first question, “How do I render a collection description on a product page?”
@fideas then that’s what I answered. Just replace “variable” with the handle of the collection you need. Read the doc. I sent you for more infos.