👀 Our most exciting product launch yet 🚀 Join us May 8th for Sanity Connect

Spaces Feature - How to Share Content Between Two Datasets

4 replies
Last updated: May 18, 2021
Hi. I was wondering if it was possible to use the
spaces
feature and have content that can be shared between two datasets like a global section?
May 18, 2021, 1:14 PM
Hi
user M
, thanks for getting back to me. That would be great if it was a feature. A use case right now is that I would like to have 'London', 'New York' and 'Global'. Global would be used to have content that would be shared across the other spaces, such as an about/contact page.
If you are able to get back to me on another point, is it possible to have multiple desks? So it would all be under the same dataset but the 'Desk' button in the studio could be renamed 'London' and I would have additional 'Desk' (New York). This was due to having a slightly neater way to organise data as I've found in some instances panels can be too deeply nested!
May 18, 2021, 4:48 PM
Hi
user M
, thanks for getting back to me. That would be great if it was a feature. A use case right now is that I would like to have 'London', 'New York' and 'Global'. Global would be used to have content that would be shared across the other spaces, such as an about/contact page.
If you are able to get back to me on another point, is it possible to have multiple desks? So it would all be under the same dataset but the 'Desk' button in the studio could be renamed 'London' and I would have additional 'Desk' (New York). This was due to having a slightly neater way to organise data as I've found in some instances panels can be too deeply nested!
May 18, 2021, 4:48 PM
Hmm, if I were trying to do this I wouldn’t set up different desks (since I’m not sure it’s a possibility). I think the best approach would be to add them to the existing structure as list items. Let my try to create an example:
S.list()
.title('Base')
.items([
  S.listItem()
    .title('London')
    .child(
    // London Structure
    ),
  S.listItem()
    .title('New York')
    .child(
    // New York Structure
    ),
  S.listItem()
    .title('Global')
    .child(
      S.documentTypeListItems()
    ),
])
May 18, 2021, 4:56 PM
☝️ that’s just a rough estimate and could take some tweaking
May 18, 2021, 4:57 PM

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?