All Questions

Filter by
Sorted by
Tagged with
7 votes
1 answer
3k views

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", ...
user1449456's user avatar
6 votes
2 answers
9k views

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 ...
kizoso's user avatar
  • 1,216
3 votes
1 answer
3k views

How to import CSV to sanity.io

Im a hobby programmer exploring the free version of the new headless CMS sanity (www.sanity.io). Bumping into a problem when trying to upload / import data into my project: Is there a way to import ...
Magnus Hillestad's user avatar
3 votes
2 answers
7k views

Sanity.io GROQ query for array of objects

I'm learning to code and now I am on the stage of a small pet project with Sanity as a CMS. Long story short, making an API I'm trying to fetch cocktails data with votes for the cocktails. The votes ...
SirMatters's user avatar
3 votes
1 answer
839 views

Sanity IO CMS - What is the difference between sanity.config.js and sanity.json

Working with a Version 3 Sanity project to provide backend data. However, I noticed that there are two files that deals with project settings/configurations. PROJECT_DIR/sanity.config.js - included ...
0x5929's user avatar
  • 440
2 votes
1 answer
1k views

Text highlight is not being applied at front-end in Sanity CMS

I am trying to create a blog using Sanity Headless CMS and React for the frontend. I have made a decorator for highlighting text. As you can see in the image below, in the editor, the highlighted text ...
HKS's user avatar
  • 774
2 votes
1 answer
635 views

Is it safe to edit the schema of a blog post in Sanity, after I already have added 4-5 long posts (using the same schema)?

I currently have a blog running on Next.js + Sanity. I have had a lot of success, but in the past when setting it all up encountered a scary error while editing the blog post schema, that basically ...
Zach White's user avatar
1 vote
1 answer
1k views

Sanity GROQ query to not return nullish values

I was querying Sanity with GROQ and wanted to get response excluding nullish values in case there is no image url is available but if it is then return the image url. Doing like this: defined(image) =&...
Suleman Ahmad's user avatar
1 vote
1 answer
2k views

Unable to add code blocks in Sanity CMS after I install the code-input plugin

I am learning to build a blog using Sanity CMS and React. I am new to Sanity. I should be able to insert code snippets in my blog posts. So, I have installed the code-input plugin. According to the ...
HKS's user avatar
  • 774
1 vote
1 answer
2k views

Sanity.io - Image URL exposure for preview/select

I have been using and enjoying Sanity and am currently doing a reasonable sized CMS build with this. I am attempting to set some "preview" images for a gallery of images (using type array). ...
Oliver Heward's user avatar
1 vote
0 answers
109 views

Creating a 3-Level Hierarchical Sanity.io Schema for Efficient Content Management

I need help creating a Sanity.io schema that allows me to structure content in a hierarchical manner like the following: - Hub 1 - Guide 1 - Chapter 1 - Chapter 2 - Guide 2 - ...
user1704894's user avatar
1 vote
1 answer
143 views

How to make studio content changes locally in Sanity

Currently, I have a Next.js site that is using Sanity. If I'm in my local environment and make changes to some content in my Sanity Studio (localhost:3000/studio), the content I add gets added to my ...
jnemec84's user avatar
1 vote
0 answers
433 views

Prerendering error when deploying next js, sanity project?

I have the following error usin Sanity cms with Next.js 13 Error occurred prerendering page "/". Read more: https://nextjs.org/docs/messages/prerender-error TypeError: fetch failed at ...
David Kiss's user avatar
1 vote
1 answer
654 views

schemaTypes in sanity io

I am facing problem in schemaTypes of Sanity io All the details are mentioned below Any problem regarding the question U can ask me userSchema.js name:'abouts', title:'Abouts', type: '...
Suyash Sharma's user avatar
1 vote
0 answers
407 views

Adding an external URL when clicking an image with the rich text editor of Sanity

I'm trying to make possible for the people using the rich text editor in sanity.studio (with no coding knowledge) to add an external link in the image they are uploading. So, then it is clickable in ...
jomaji's user avatar
  • 11
1 vote
0 answers
1k views

How to make child looks like relative in sanity.io?

I have a formed structure of documents: { name: 'item', title: 'item', type: 'document', fields: [ { name: 'category', type: 'reference', title: 'category', to: ...
kizoso's user avatar
  • 1,216
0 votes
2 answers
5k views

Using the Sanity client without specifying an API version is deprecated

I am getting this warning in the console and could not able to clearly understand the documentation. warnings.js:16 Using the Sanity client without specifying an API version is deprecated. See https:/...
harsha20599's user avatar
0 votes
1 answer
823 views

Gatsby not watching sanity for new published changes

I have a Gatsby site deployed to netlify. In development mode I set the option watchMode:true of gatsby-source-sanity in gatsby-config.js and this works fine to watch sanity studio for changes but in ...
Inioluwa Sogelola's user avatar
0 votes
1 answer
345 views

Getting issue while fetching prev/next post from Sanity CMS ( Next js +Sanity static blog)

I'm using Sanity CMS, and trying to fetch previous and next post using this query below. const query = `*[_type=='post' && slug.current == $slug][0]{ _id,title,_updatedAt, "...
Amit Kumar's user avatar
0 votes
1 answer
199 views

How to add params an array of values inside getStaticPaths

I have a page it structure is the following : /read/[slug]/[number] I want to get the slug value that corresponds each number in the getStaticPaths This is the code : export async function ...
Yaakoubi Mohammed's user avatar
0 votes
1 answer
398 views

Accidently deleted sanity studio from pc, How can I get my schema back?

My noob ass removed Sanity Studio from my pc ( didn't initialize it as git repo). Now is there any way to get the studio back to the pc for local development from the deployed studio? I deployed the ...
ayushgupta's user avatar
0 votes
1 answer
1k views

Gatsby Query for specific post using slug

I'm attempting to query for a specific blog post using the slug - so that a specific post is shown depending on the slug. I have encountered the following error: TypeError: Cannot read property 'Title'...
JordanMiguel's user avatar
0 votes
2 answers
624 views

How to change field style in the sanity io user interface?

How can I change a style of a component easy? I just want limit a text-field height in a sanity user inerface. It is uncomfortable to scroll all the text every time. Where can I write something like ...
kizoso's user avatar
  • 1,216
0 votes
0 answers
9 views

Sanity GROQ Filter Query

i would like some help with GROQ. So I have a document called careers which has 2 fields. department and listings. These 2 fields are documents of their own so they are referenced within careers. ...
Kirigaya's user avatar
0 votes
0 answers
54 views

Error: The studio server does not have access to listen to given port do you have access to listen to the given host (localhost)? on macbook sanity

Error: The studio server does not have access to listen to given port do you have access to listen to the given host (localhost)? on macbook sanity project Error: The studio server does not have ...
Nads's user avatar
  • 1
0 votes
0 answers
32 views

Schema Config with Custom Input

So I am working on a multi-stage select input in Sanity. { name: 'home', title: 'Home', type: 'object', fields: [ { name: 'team', title: 'Team', ...
snake202222's user avatar
0 votes
0 answers
81 views

I am getting error of "TypeError: Cannot read properties of undefined (reading 'title')" while deploying my nextjs app

I'm using nextjs as framework trying to display my blogposts which are on sanity using slug. The sanity's schema I have chosen is of blog type and sanity is in typescript while nextjs app is in ...
Saqlain Afroz's user avatar
0 votes
1 answer
88 views

How To Access Sanity Desk

I just finished my React app using sanity as the backend. I deployed the app and it's working fine but whenever I want to add data to the database I find myself accessing the database through the ...
mo7amed's user avatar
  • 53
0 votes
0 answers
294 views

Im getting an "The default export of @sanity/client has been deprecated. Use the named export createClient instead" warning. What is the problem?

I am trying to implement sanity into an existing project built with astro. I have followed this tutorial - step by step, https://www.sanity.io/guides/sanity-astro-blog I'm not sure what the issue is ...
Germán Rojas's user avatar
0 votes
0 answers
8 views

can we use conditions in sanity schema

i have a schema named -'category', the other scheme is named -'Box' and the category scheme is referenced inside the 'Box' schema . What i want is if there are 2 categories ('catg 1' and 'catg2'), and ...
Shubham Yadav's user avatar
0 votes
0 answers
23 views

Next.js, SanityCMS link issue - all page is link

if I open link which go outside app and use back button in browser then if click on every space on page this link is opening. How it works this way? How to fix it? Example: https://www.infele.pl/...
Jullew's user avatar
  • 13
0 votes
0 answers
55 views

How can I check if a document has an object with the same key and value as an array of objects?

I have a product document, and each product has an array of "productFilters", with this shape: { name: "Filter Name", value: "Filter Value", } For my params, I have ...
greatbearshark's user avatar
0 votes
0 answers
47 views

sanity shopify assets plugin fails

This may be too vague, but ask any question and I will try to get code or give an explanation to troubleshoot this issue. We are using Sanity to build out a cms for our Shopify store, at this point we ...
SocaBlood's user avatar
  • 189
0 votes
0 answers
403 views

Issue with Sanity Next.js Live preview mode

I am trying to implement live preview mode for the blogs on my Next.js website. I followed all the steps mentioned in the Sanity docs (https://www.sanity.io/guides/nextjs-live-preview) and to ...
coderX's user avatar
  • 203
0 votes
1 answer
1k views

Check in groq query if array of objects contains a case insensitive string

I have an object that has an array called tags. It is array of objects. I need to query those objects that its tags contains a case insensitive string. [ { "_createdAt": "2022-02-...
mahan's user avatar
  • 13.7k
0 votes
1 answer
44 views

Sanity Studio CMS on initialise script (upstart)

Is there a way to hook into the Sanity Studio initialise step? Or perhaps start the Studio from a js module so I can wrap it in some logic? My motive is, in development it can be confusing which ...
Lex's user avatar
  • 4,873
0 votes
1 answer
433 views

How to create a custom endpoint in Sanity CMS?

I have a Sanity CMS with some data and a Gatsby frontend which fetches the data from Sanity via GraphQL. This works well in most cases but I would need a custom endpoint which gives back a document ...
laszlo_kiss's user avatar
-1 votes
1 answer
361 views

How to get all the params values in getStaticProps [duplicate]

I am trying to figure out a way to map both slugs and paths in order to get all their values in the params : This is my code : export async function getStaticPaths() { const slugs = await client....
Yaakoubi Mohammed's user avatar