Questions tagged [sanity]

Sanity is a structured content platform and API that also offers an open source, React-based Studio that functions as like a headless CMS on top of the Sanity APIs.

Sanity treats content as structured data and makes it easily available over an API. The collaborative editor, called the Content Studio, is a fully customizable, client-side web application. Documentation here.

833 questions
74
votes
1 answer

Next.js: Reduce data fetching and share data between pages

I'm looking for solutions for better data fetching in a Next.js app. In this question I'm not just looking for a solution, I'm looking for multiple options so we can look at the pros and cons. The problem I have Right now I have a few pages that all…
eivindml
  • 2,197
  • 7
  • 36
  • 68
11
votes
3 answers

Sanity Studio: Parsing Error for Babel Preset Env

I'm new to working with Sanity, and just set up a project. Everything is working fine, however, in Visual Studio Code, I keep getting a parsing error that won't disappear, and I'm wondering how I can fix it. Parsing error: Cannot find module…
Jon Lothar
  • 186
  • 1
  • 7
10
votes
3 answers

Text/Image alignment in Sanity.io portable text rich text editor

Is there an option to align text (and also an image) to the center in sanity.io's rich text editor (Portable text)? Couldn't find anything in the docs
Uri Klar
  • 3,800
  • 3
  • 37
  • 75
9
votes
10 answers

Sanity.io [vite] Internal server error: [postcss] Cannot read properties of undefined (reading 'config') error

Spinning up the sanity studio gets me this error. The page spins up just fine in local host. Any help fixing this would be greatly appreciated here is the error in full: [plugin:vite:css] [postcss] Cannot read properties of undefined (reading…
toadlyfe
  • 411
  • 1
  • 3
  • 7
8
votes
1 answer

How to upload multiple images to sanity.io?

I am searching for a way to uploading multiple images to sanity.io. Only thing that I found is this issue. But maybe there is another way. Some npm-plugin or node.js app approach. I'll be grateful for the help.
7
votes
2 answers

Getting the "URLSearchParams.set is not implemented" error when trying to fetch data from my sanity backend using React Native

I am getting an error in my to react native project when pulling data from my sanity backend    this is the error URLSearchParams.set is not implemented This is where I am fetching he data  import {View, Text,SafeAreaView,Image,TextInput,ScrollView}…
7
votes
2 answers

Old records still showing on Sanity

I have created a Sanity.io CMS, I have made some alterations to the schema after content had already been entered. The problem now is that the content is still saved somewhere inside the cms and I have no way to remove it.
Aiden Barrett
  • 329
  • 1
  • 4
  • 11
7
votes
1 answer

How to create default value in field using sanity.io?

Is it possible to add to sanity field with default value? How can I extend it? I want to create some fields with default variables. For example I have this code: export default { name: 'name', title: 'name', type: 'document', fields:…
kizoso
  • 1,216
  • 2
  • 15
  • 30
7
votes
1 answer

Can't make search query work in Sanity CMS

I am trying to perform a very basic search query with Sanity CMS. This is how the person schema I've created looks like: export default { title: "Person", name: "person", type: "document", fields: [ { title: "Name", name:…
user1449456
  • 502
  • 1
  • 5
  • 19
6
votes
2 answers

How to make sanity io array select as multiselect?

I have a lot of tags, and I need to select a lot for each document. It is uncomfortable to click one by one every time. Also I see selected elements. How can I remake it into somefield like a multiselect? It could be even native. Or how to select…
kizoso
  • 1,216
  • 2
  • 15
  • 30
6
votes
1 answer

How do I make a inner join as a condition in GROQ?

I have a dataset with posts, which might have an array of categories. How do I make a GROQ query that selects all posts with a category with the title "Page"? I would think that I could do something like this: *[_type == 'post' &&…
dotnetCarpenter
  • 10,019
  • 6
  • 32
  • 54
6
votes
1 answer

How to fill arrays of references in a single query

I have a schema type Page which has an array of blocks: { title: 'Page', name: 'page', type: 'document', fields: [ ... { title: 'Blocks', name: 'blocks', type: 'array', of: [ {type: 'tileGrid'}, …
Slem
  • 108
  • 1
  • 6
5
votes
2 answers

Sanity and Nextjs: content is not updating until re-deploy

I am having an issue getting content from my production Sanity Studio onto my production blog. I am using Next.js v13 and Sanity v3. The site is deployed on Vercel. When I post from both my local Sanity Studio and production Sanity Studio, it…
techmeowt
  • 173
  • 1
  • 11
5
votes
4 answers

The following files share their name; please adjust your hasteImpl: * \package.json * \sanity\package.json

This is my first time using sanity and I have encounter with this problem, When running expo start , I will be very thankful if you can help me with this jest-haste-map: Haste module naming collision: deliveroo-clone The following files share their…
5
votes
2 answers

Is there a way to get a structure of a Strapi CMS Content Type?

A content-type "Product" having the following fields: string title int qty string description double price Is there an API endpoint to retrieve the structure or schema of the "Product" content-type as opposed to getting the values? For example: On…
junerockwell
  • 838
  • 1
  • 9
  • 29
1
2 3
55 56