✨Discover storytelling in the AI age with Pixar's Matthew Luhn at Sanity Connect, May 8th—register now

Schema - How to Create Tags with Initial Values

5 replies
Last updated: Mar 4, 2021
Hey! How would one go about to create tags with initial values? I would like my users only to be able to choose between three tags. Do I have to do this with Category?
Mar 4, 2021, 12:13 PM
You can create a list like this:

{

title: 'Genre',

name: 'genre',

type: 'string',

options: {

list: [

{title: 'Sci-Fi', value: 'sci-fi'},

{title: 'Western', value: 'western'}

], // <-- predefined values

layout: 'radio' // <-- defaults to 'dropdown'

}

}
Mar 4, 2021, 12:17 PM
Thank you!! 🙂
Mar 4, 2021, 12:21 PM
I had a reply typed out for this but forgot to hit enter haha
Mar 4, 2021, 12:22 PM
So, what
user C
said 😄
Mar 4, 2021, 12:22 PM
Haha!Thank you anyway 😉
Mar 4, 2021, 12:22 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?