Short description of issue
Add a new page template to live theme but not expose the page until the code is styled and tested?
Link to Shopify Store
Reproduction steps
- Pulled the live theme
- Added page.community-gardens.liquid + assets
- Pushed and created a hidden gallery page with community-gardens template
- shopify theme dev
Yes, proceed with live theme
- Accessed the preview URL /pages/gallery
- Always get 404
I need a way to preview the new template?
Is the only option to make it visible? It’s still in the works so don’t want it to be live.
Are there any other ways to do this? I tried with a draft theme but you cannot access new page templates from the draft theme.
I need a way to develop this new theme functionality without exposing it live to customers?
Additional info
No additional info
What type of topic is this
Troubleshooting
General discussion
I had this idea - anyone have a better one?
what about this:
- add new template page.community-gardens.liquid to live theme
- create the new page and publish it (done up to here)
- Duplicate the live theme
- Pull the new live duplicate draft
- Run theme dev
- now the new page is live - will the draft theme be able to access it?
Yes that workflow works! Here’s why:
-
The page is live and visible so no 404
-
shopify theme dev against the draft theme will serve the page using the draft’s page.community-gardens.liquid
-
Any changes you make to the template/CSS/JS in the draft are reflected instantly at 127.0.0.1:9292/pages/gallery
-
When done, push the draft changes to live
The only downside is the Gallery page is publicly accessible during development, but since it’s not in the nav customers are very unlikely to find it.
The downside is acceptable. I can push a blank template with “coming soon” to the live site and then just do all css/js on the draft so it’s hidden from live
Hi @Justin_Eady, have you tried this appending this parameter:
?view=handleized-name-of-template
More about this here:
Awesome, that is the ticket! Sidekick was leading me down the garden path because it said hidden pages are visible in dev. I knew there had to be a way to do this correctly:
In my case for the gallery page to switch views: pages/gallery?view=community-gardens