Is it possible to use Structured Text inside a plugin?

I understand that Dato provides a number of design system components such as TextInput, but I don’t see any way to add Dato’s structured text.

Is this possible? Ideally, I would like to reference a preconfigured StructuredText field that I’ve already built in another model.

1 Like

Hi @nickk,

Welcome to the community, and thanks for the question!

Do you want to render Structured Text output (as it would be seen on a finished frontend)? If so, you can use react-datocms/docs/structured-text.md at master · datocms/react-datocms · GitHub

If you want to actually add the Structured Text editor to a plugin via source, I’m afraid that’s considered part of our closed-source CMS software and not one of our open-source plugins.

However, maybe a middle ground there could be a feature request that would let you reference the built-in editor UI for another field…? (I hope I’m understanding your request correctly).

An example use case in that feature request might be helpful, too, to help us better understand how you’d like that plugin to function?

Thank you again for the feedback, and sorry I don’t have a better answer for you!

Thanks for the reply!

I was aware of the React StructuredText component from react-datocms, but since it seems like there is no way to add the closed source editor that you mentioned, I don’t think there would be a good way to use that component in a plugin.

Yes, I think that sounds like exactly what I’m looking for. For context, my team has created a separate block with a structured text field with all the marks and custom blocks we want. This separate block is then referenced in a number of our fields rather than having to redefine a structured text field separately on each model.

Ideally, I could reference this model and have the structured text editor show up within a custom plugin.

I see. Thanks for the explanation, @nickk!

Can I turn this thread into a feature request for you, or would you like to start one yourself at ✋ Feature requests - DatoCMS community?