All things Shopify and commerce
I want to take all of the pages I have created and list them out on one Shopify page, so I'll end up with a list of links like:
https://domain.com/pages/this-page
https://domain.com/pages/that-page/
https://domain.com/pages/another-page/
I found some Twig code and I have tried to insert it into another page, but it just displays the code and not the pages:
{% for page in pages %}
<a href="{{ page.url }}">{{ page.title }}</a>
{% endfor %}
Has anyone attempted this before?
Solved! Go to the solution
This is an accepted solution.
You have to do it through some steps
1. Create a page in backend
2. Search your page in theme customize
on a screen like this
3. Create a page template from here or through liquid code
4. Add that code in directly in theme code in that template or add a custom liquid section in newly created template
Please check if you are able to do that on your side or you need more assistance.
Thanks!
Hi,
It should work fine
Where are you trying it, Can you please explain more ?
Here is the Shopify Doc regarding it
Thanks!
I want to create a page in the usual way from:
domain.myshopify.com/admin/pages/new
and on this page can I paste some Twig content? Like pasting in raw HTML except I'd like to use Twig, like this somehow:
Is this possible?
Custom liquid will not work in page description, you can create separate template for that and put this code there in theme files
Could you give me a pointer how I could create a page with just a list of my pages on? I am familiar with using Liquid/Twig.
I need to create a list of pages automatically.
Yes, it will be automatic list of all pages on the website but you have to put your code in liquid, in page content, liquid code does not work.
Thanks!
So I would create a page that I could access by /pages/page-name and then I put the Liquid code into a template. How do I unite these two processes?
This is an accepted solution.
You have to do it through some steps
1. Create a page in backend
2. Search your page in theme customize
on a screen like this
3. Create a page template from here or through liquid code
4. Add that code in directly in theme code in that template or add a custom liquid section in newly created template
Please check if you are able to do that on your side or you need more assistance.
Thanks!
Hi,
thanks for this solution! But I wonder if there is a way to show only a certain type of pages? For example pages with the prefix "/pages/forfattare/xxxx".
With kind regards,
- Johan.
Hi @johstrom
Please try metaobject pages: https://help.shopify.com/en/manual/custom-data/metaobjects/webpages for such structure, also you can assign a custom template to metaobject pages
I hope, it will be helpful for you
Thanks!
Hi!
@pawankumar wrote:Please try metaobject pages: https://help.shopify.com/en/manual/custom-data/metaobjects/webpages for such structure, also you can assign a custom template to metaobject pages
This is exactly what I have done. But now I want to show these metaobject pages for the visitor (and for Google) in a good way. I can't find out how I can showcase them. If it were a blog I could create a page and set up a section for showing blog posts, but all these metaobject pages is just there in the background - hopefully Google find them with the sitemap (seems to be present there), but a visitor can't find them at all. These pages isn't even searchable - though I have asked Search & Discovery to show search results for "Pages" - it seems only show manual, ordinary pages.
Any ideas?
Those are already searchable if you have enabled them from metaobject definition. And those are included in sitemap as well. To show them to the visitor you can add them to navigation, you can add other sections to these from metaobject page template and you can get their link from content tab in left side bar in admin
Thanks
2m ago Learn the essential skills to navigate the Shopify admin with confidence. T...
By Shopify Feb 12, 2025Learn how to expand your operations internationally with Shopify Academy’s learning path...
By Shopify Feb 4, 2025Hey Community, happy February! Looking back to January, we kicked off the year with 8....
By JasonH Feb 3, 2025