I have added a metafield to a collection within my Shopify store. I have a namespace, key, and value. I am looking for a liquid code snippet to check if the collection has a specific metafield key, and then if so, to output the assigned value.
I have tried the following with no success:
{% if relationship = collection.metafields.parent %}
<span>{{ relationship.parent[value] }}</span>
{% endif %}
Does anyone have any idea of how I could implement this functionality?
Thanks.
relationship
,value
andcollection.metafields.parent
? Wouldn'tcollecation.metafields.parent
just be the namespace and not a specific metafield? – Sam