Solved

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

etienne21
Explorer
51 2 29

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,

Accepted Solution (1)

etienne21
Explorer
51 2 29

This is an accepted solution.

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.

View solution in original post

Replies 6 (6)

etienne21
Explorer
51 2 29

This is an accepted solution.

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.

YellowStars1
Tourist
7 0 2

Life Savor for this Shopify Community!

joe05
Shopify Partner
1 0 0

Arigato Gozaimasu

Caity
Shopify Partner
1 0 0

Bless!!

AMCEnterprise51
Tourist
7 0 1

Finally, mine also works. Thank you !

nomanmarwat
Shopify Partner
2 0 1

Thank you, you're life saver.