Creating and using JSON templates
In this documentation post, we'll take a look at JSON templates and how to add them to your store.
Note: You don't actually need to be on the latest version of the Palo Alto theme in order to do this. It will work on all themes but our latest version uses JSON templates exclusively.
What are JSON templates?
They still will not display different content if used on more than one page, but improvements have been made by Shopify in the adoption of meta fields and you will be able to create pages that have the same structure but have different photos and text.
How to create a JSON template.
A box will pop up asking what kind of a template you'd like to create and if it should be a JSON or a LIQUID template. For the purposes of this tutorial, we'll create a 'page' template but the process is almost identical for creating product pages, article pages, and so on:
Make sure to also give your template a name that will be easy to remember and that would show its purpose and click on 'Create template'. This will create the template but we still have one final step to go. When the template is created, there will be a small bit of code. You will need to delete it and paste this little snippet in its place:
{ "sections": { "slideshow": { "type": "slideshow", "settings": { } } }, "order": [ "slideshow" ] }
Once you're done, click Save. It could take a few minutes for it to fully load but once it's done, you will find it inside of the Pages tab in your Theme Editors drop-down menu:
Creating more templates.
All you need to do is give the new template a name, select the template it's going to be based on, in this case, it's the one we just created and is selected automatically, and click on 'Create template':
That is it, all that's left is to set them up with sections and assigning them to your pages.
Assigning the templates.
Inside this editor, you'll need to scroll down to 'Theme template' and select the template you'd like to assign:
Once you're done, Save the changes and you're good to go!