How can I display a page body using a page object in metafields?

Hello,

In Metafields I created a Page reference definition that I want to show on my product page.

when I try to publish this on my product page {{variant.metafields.my_fields.mypage | metafield_text }} it only shows the title of the product page, but not the body/contents.

If I leave out “|metafield_text” I get gid://shopify/OnlineStorePage/1234123414. Which if I am not mistaken is the Page Object.

I also looked at Shopify.dev and they only reference to the title.

Is there no way to get a page body out of a page object?

Thanks,

Ok after hours of researching and trial and error:

{{ variant.metafields.my_fields.mypage.value.content }}

is showing me the contents (body) of the page as I wanted.

8 Likes

Life Savor for this Shopify Community!

1 Like

Arigato Gozaimasu

Bless!!

Finally, mine also works. Thank you !

Thank you, you’re life saver.

1 Like