Can't add title or subtitle to Sanity array, only image works

30 replies
Last updated: Nov 29, 2025
Any idea why this isnt working? I can add a image, but not title or subtitle
export default {
  title: 'Columns',
  name: 'columns',
  type: 'array',
  of: [
    {
      name: 'columnTitle',
      type: 'string',
    },
    {
      name: 'columnSubTitle',
      type: 'subTitle',
    },
     {
      name: 'columnImage',
      type: 'image',
    },
  ],
};
AI Update

I can see the issue! When you define an array in Sanity, the of property should contain object types, not just plain field definitions. You're defining fields like you would in a document or object type, but array members need to be wrapped in an object type structure.

Here's the corrected version:

export default {
  title: 'Columns',
  name: 'columns',
  type: 'array',
  of: [
    {
      type: 'object',
      fields: [
        {
          name: 'columnTitle',
          type: 'string',
          title: 'Title'
        },
        {
          name: 'columnSubTitle',
          type: 'string', // Changed from 'subTitle' unless you have a custom type
          title: 'Subtitle'
        },
        {
          name: 'columnImage',
          type: 'image',
          title: 'Image'
        },
      ],
    },
  ],
};

The key changes:

  1. Wrapped everything in an object type: The of array should contain object definitions that have a type: 'object' and a fields array
  2. Added the fields property: Your title, subtitle, and image fields go inside the fields array of the object
  3. Fixed the subtitle type: Changed type: 'subTitle' to type: 'string' (unless you have a custom subTitle type defined elsewhere)

The way you had it, Sanity was treating each item as a separate type that could be added to the array (like how block content arrays can have different types of content). But what you want is a single object type that contains all three fields together.

Now when you add an item to the array, you'll get a single object with all three fields (title, subtitle, and image) that you can fill in. The image worked before because image is a valid standalone type, but string fields need to be part of an object structure within arrays.

Show original thread
30 replies

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.

Was this answer helpful?