Join us for an upcoming Shopify Partner webinar on February 27, 2024. Discover the latest Checkout Extensibility features, and deep dive on improvements to Shopify Functions and Web Pixels. Register now for either the 10am EST or 2pm EST sessions.

Managing default JSON files in the same GIT theme across different stores

MathijsDelva
Shopify Partner
24 0 3

I'm struggling with the following scenario:

 

- I have one theme, using GIT integration

- I have multiple plus stores for the same brand, for each locale/language

- I can translate all repo files using the normal locale/**.json and translation string logic

- Brand managers can create content pages for each store using the theme customiser and sections, which in their turn create page.xxx.json files in the live theme, which in my turn i pull using the theme:pull feature so they are added to the repo

- The pages will always be locale-unique, meaning we would have something like page.landingpage-uk.json, page.landingpage-it.json, ... which means they can just sit safely next to each other in the templates folder

 

So far so good. But, here the problem comes in: what about the uniquely-named shared default files like index.json, product.json, ... If these files are being edited using the theme customiser, they are overwritten with the language/locale from the store where it was just edited in. That means there would need to be a index-de.json, index-uk.json, index-it.json, .. which is of course not allowed nor possible as Shopify only expects index.json.

 

I thought about using the 'context' feature (described here: https://help.shopify.com/en/manual/online-store/themes/customizing-themes/store-contextualization) but after a talk with Shopify Plus Support, it appears these context specific versions of a page will only show based on a geolocation app (meaning, index.context.[markethandle].json would only be served if the visitor is located in France). So that's not an option.

 

In short: how do i serve locale-specific shopify-unique JSON page templates like index.json across multiple stores using the same connected GIT theme? 

Replies 2 (2)

Liam
Shopify Staff
2641 285 721

Hi MathijsDelva,

 

The native GitHub Integration is primarily built for managing safe theme deployments to a single store, although some devs have implemented workflows that allow for scenarios where themes are different, using conditions and GitHub workflows - as in this forum post and this blog post

 

There are also some community built tools like Shopkeeper that may help with your setup. 

 

Hope the above helps!

Liam | Developer Advocate @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

MathijsDelva
Shopify Partner
24 0 3

Hi Liam, thank you for your reply. The forum & blog posts gave me some insights, but i feel that's quite dangerous terrain and also a lot of configuration to just to safeguard a few different versions of JSON data. I would really like some better support and insights from within the Shopify Dev Front-end team on this issue, as i feel this is something quite basic to support out of the box. Thanks for your reply Liam!