Unlock seamless workflows and faster delivery with our latest releases - Join the deep dive

Discussion about using Sanity as a multi-site CMS and the different approaches to achieve it.

9 replies
Last updated: Jun 3, 2022
Has anybody used the experimental spaces feature to setup Sanity as a multi site CMS? I’m thinking about the best way to setup Sanity to handle 5+ different websites
May 10, 2022, 4:30 PM
If the schema is the same, it'll be super easy to pull off. You'll just need to switch datasets.
It gets a bit trickier if you need different schema for each site. You'd need to include all of the possible schema in your
schema.js
file, then
May 10, 2022, 5:16 PM
It's totally possible. You have a few different options for your approach.
I have a Studio that I use for support that technically has 4 different Studios mashed together in it. They're all in the same dataset and I use a custom structure to handle their separation (see attached screenshot).

If you want more separation, you can have your structure check which dataset is selected and return a completely different structure for each one. You'd still need to add all of the possible schema options to your
schema.js
though.
May 10, 2022, 5:30 PM
We use Sanity for a "multisite" with 3 spites within the same dataset. How we solve it is having a "site" document and documents referencing this site. We make the UX better by having custom desk structure and initial value templates to hide this reference mostly from the user.
A big bonus from this is that we can easily share content across the different sites, as some document types are nice to share, and you also share the same media.
May 12, 2022, 8:29 AM
user M
Hi! I am looking at setting up a multisite also, and came across Spaces.
It looks great, but I would consider doing it the way you’ve shown, all within 1 dataset.

The only issue is that we need to sync multiple Shopify accounts to Sanity, a different one for each storefront, due to being for different countries of the same company.

Would this be possible within 1 dataset, or would it make more sense to use Spaces?
May 26, 2022, 12:08 AM
Hey
user N
! Sorry this got missed. It's really difficult to track tickets when they get opened in old threads that have already been resolved. If you open up a new thread next time, you're more likely to get faster follow up 🙂
I'd say yes, this method with a single dataset could very likely work for you. I don't have a ton of experience syncing from Shopify, but since you can specify custom sync scripts using data from different shops shouldn't be an issue.
Jun 2, 2022, 10:55 PM
Hi RD, noted! Thanks for the reply regardless.We have been in touch with sales support and are working through this with them, so a solution is on the way! Will post about the project once we do get it completed as would be an interesting case study
Jun 2, 2022, 10:59 PM
Sales reached out to me for help with your email, which triggered a memory of this showing up in my threads one morning 😅. Our ticket tracking system doesn't do so well with tickets in threads, so unfortunately it was up to my fickle memory here.
Jun 2, 2022, 11:03 PM
Feel free to drop a thread in the help channel as you work through your build if you need more specific help.
Jun 2, 2022, 11:04 PM
Ahh ok great, yes I will do, I’m sure there will be some back and forth on this process.
Jun 3, 2022, 3:46 AM

Sanity– build remarkable experiences at scale

Sanity is a modern headless CMS that treats content as data to power your digital business. Free to get started, and pay-as-you-go on all plans.

Was this answer helpful?