Embedding pages.content into a product page

Taking a topic out of the grave from a post 4 years old.

I’m trying to embed the content from a page into the product template. I saw some code and thought it would work.

{% assign featurepage = product.handle %}
{% if pages[featurepage] %}
   <div>
    {{ pages[featurepage].content }}
  </div>
{% endif %}

Yes, product handle matches the page handle. It just doesn’t embed the content, but I know it’s somehow working as i can get it to print the page title by using .title :

{% assign featurepage = product.handle %}
{% if pages[featurepage] %}
   <div>
    {{ pages[featurepage].title }}
  </div>
{% endif %}

I’ve also tried using content_for_layout and content_for_head, but still not working.

Any ideas? I’m hoping a shopify dev could help, if not the wonderful community in here.

it could probably be a wrong syntax or maybe the code is missing something in it

Hi,

Hope this will help

  • Create a Page
  • Get Page “Handle”
  • Edit Your Product Page Template (Sections/product-template.liquid or main-product.liquid)

Code example

{% assign my_page = pages['shipping-info'] %}
{{ my_page.content }}