Issue with customizing a portableText field in Sanity.io studio

5 replies
Last updated: Dec 2, 2022
Hello! I'm trying to customize a portableText field so that I can insert references to other content. I've followed this tutorial (https://www.sanity.io/guides/portable-text-internal-and-external-links ) to add a mark in my studio, but where they show the "S" button I just have a question mark. I cannot find errors in my JavaScript console nor the console I'm running studio from. How can I figure out what's gone wrong here?
Nov 22, 2022, 10:12 PM
Could you share the code for it please ☺️
Nov 22, 2022, 11:25 PM
Absolutely!

export default {

name: 'content_internal',

type: 'document',

title: 'Content (Internal)',

fields: [

{

name: 'title',

type: 'string',

title: 'Title'

},

{

name: 'body',

type: 'array',

title: 'Body',

of: [

{

type: 'block',

marks: {

annotations: [

{

name: 'external_content_link',

type: 'object',

title: 'External Content Link',

fields: [

{

name: 'reference',

type: 'reference',

title: 'Reference',

to: [

{type: 'content_external_a'},

{type: 'content_external_b'}

]

}

]

}

]

}

}

]

}

]

}
Nov 23, 2022, 12:27 AM
And for reference, this is what I'm seeing. It seems to still work as intended, so perhaps it's just a UI bug?
Nov 23, 2022, 2:41 PM
Hey
user B
! You'll want to add a custom icon using the method shown here .
Nov 28, 2022, 7:47 PM
Thank you very much, this worked!
Dec 2, 2022, 6:15 PM

Sanity– build remarkable experiences at scale

The Sanity Composable Content Cloud is the 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?