We run a number of white label eCommerce stores on Shopify. I'm currently working on trying to simplify the setup of new stores while also allowing us to modify multiple stores simultaneously using Git. We'd push code to multiple stores while ignoring the settings files that hold all design related variables. This would allow us to focus more on improvements/features and less on making sure all of our themes are running the same versions.
We have a number of pages that will be almost exactly the same across all stores. Pages like FAQs, Contact, TOS, Returns, Etc. It would be incredible if I could add these pages at a theme level using global variables to change things such as business names, Addresses, Etc. Then link to them in our footer without ever needing to enter Shopify admin. This way, if we need to make a change to a policy, we can push the change to all of our stores simultaneously using Git.
I haven't found a way to do this yet, though.
Can we add a page in our theme files that utilizes variables and then link to this page without ever building menus in Shopify Admin? If so, how?
Solved! Go to the solution
This is an accepted solution.
Even if you build separate templates for each page type and completely disregard the actual page content, to favour a less dynamic version, I still can't see how you would be able to avoid actually creating the pages in the first place. Pages are part of the Online Store, so the structure and features (titles, handles, etc) are managed through the Pages section directly. Since pages are built to be independent of your chosen theme (which makes sense if you don't want to lose precious content, if you decide on changing it), you can't actually manage them from within one.
This kind of solution would work if you decided to go completely headless, and use Shopify only for the products and transactional data.
Thanks @pvoulg ,
I kind of suspected this but I was hoping there was some hidden way to pass the creation of some default pages through the config files.
I think we can still get pretty close for the purposes of maintenance by just creating a page template like you suggest. We'd still have to create the pages that use the proper template but at least future updates would go smoother.