i am trying to add a string object to every image in an array in sanity, but i am not successfull altough my solution makes pretty much sense to me:
{
name: 'images',
title: 'Images',
type: 'array',
of: [
{
name: 'image',
type: 'image',
title: 'Image',
options: {
hotspot: true,
},
fields: [
{
name: 'alt',
type: 'string',
title: 'Alternative text',
},
],
},
],
},
All what is displayed in sanity studio is the field to upload an image, can somebody help me with what is wrong here?
Use an object type:
{
name: 'images',
title: 'Images',
type: 'array',
of: [
{
type: 'object',
name: 'person',
fields: [
{
name: 'alt',
type: 'string',
title: 'Alternative text',
},
{
name: 'image',
type: 'image',
title: 'Image',
options: {
hotspot: true,
},
},
]
}
]
}