liquid
liquid copied to clipboard
URL Metafield Doesn't Return as String
I have a "URL" type Metafield, which according to the documentation should return a string. However, it does not appear to do so:
{%- if collection.metafields.url.link contains 'http' -%}
Will not return true. However, if I first "stringify" it (in this case by downcasing):
{%- assign url = collection.metafields.url.link | downcase -%} {%- if collection.metafields.url.link contains 'http' -%}
Will now return true. So what is being returned is not a string, but I am unsure what it would be.
Thanks for this, I thought I was going crazy. Not sure what the logic is behind that but this workaround does the job.