I have created a page from the admin section and I have created an alternate template for it. So when I view the page, I add ?view=‘alternate-template-name’ at the end of the url. In my template, I am trying to fetch the page.title and page.content from the page that I have created for this page. But I don’t have access to the page object in here. How can I access the information on the page?
2 Likes
Sorry you are facing this issue, it would be my pleasure to help you.
Welcome to the Shopify community! ![]()
Thanks for your good question.
Please share your site URL,
I will check out the issue and provide you a solution here.
Hi @avocado23 ,
I am not sure really why are you are using fetch to get the page.content and and page.title. The fetch function does not pass on an object. You can use section rendering if that is what you are trying to do.
If you really want to use the page object you need to use a liquid code with the page handle. Please refer to the code below. Refer the documentation here
{{ pages["page-handle"].content }}
Hi @avocado23 ,
You just need to add ‘Custom Liquid’ section and add following code, it will display fine:
Hope it helps!
