liquid icon indicating copy to clipboard operation
liquid copied to clipboard

URL Metafield Doesn't Return as String

Open wickcreative opened this issue 3 years ago • 1 comments

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.

wickcreative avatar Jan 13 '22 19:01 wickcreative

Thanks for this, I thought I was going crazy. Not sure what the logic is behind that but this workaround does the job.

NebularNerd avatar Sep 26 '24 20:09 NebularNerd