How AI is powering better personalization in e-commerce [with Vercel]. Sign up now

Schema - How to Create Tags with Initial Values

5 repliesLast 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?
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' // &lt;-- defaults to 'dropdown'

}

}
Thank you!! 🙂
I had a reply typed out for this but forgot to hit enter haha
So, what user C said 😄
Haha!Thank you anyway 😉

Was this answer helpful?

Sanity – Build the way you think, not the way your CMS thinks

Sanity is the developer-first content operating system that gives you complete control. Schema-as-code, GROQ queries, and real-time APIs mean no more workarounds or waiting for deployments. Free to start, scale as you grow.

Related contributions