Using liquid filter to display metaobject fields using custom liquid block in theme editor.

I’m trying to reference information from a metaobject in the custom liquid block for different templates. For instance, I have a metaobject with fields of data that I want to display on a collections page. I know I can use the “connect to dynamic source” option on blocks. But I want to use {{ }} syntax to reference a field in a custom liquid block, as I’m trying to do something specific. The documentation here shows thatI should used the following syntax:

{{ shop.metaobjects.testimonials.homepage.title }}
{{ shop.metaobjects['highlights']['washable'].image.value }}

So my syntax comes out to:


{{ shop.metaobjects.mtn_info.beaver_creek.mountain.value }}

But this returns nothing. In fact, I can’t get the custom liquid to display any info at all from my metaobject.

I have confirmed and triple checked the type and key names. The only thing I’m not 100% sure about is what the handle is. Is this the same as entry name? I can’t find anywhere where it specifically states what the handle is.

Can anyone help please?

Ok the next resource I checked explained that handles use hyphens “-” for spaces so my tag should have been:


{{ shop.metaobjects.mtn_info.beaver-creek.mountain.value }}

I’m leaving this here since I couldn’t find that info stated clearly in the metaobject documentation, and hopefully this helps others.

1 Like