Using the Markdown Editor within a UI extension

I am creating a UI Extension.

The extension is on top of a JSON field.

The UI for this field has a bunch of inputs to edit the various fields of this JSON object.

One of these fields on the JSON object is going to be a markdown string. I’d hate to have to bring in a completely different markdown editor… is it possible to embed the existing Contentful Markdown editor within this UI extension? Or at the very least, is there like a base Markdown edtior that you extend that I could use, that would be similar to your own?

Hi @jason1!

Unfortunately, I don’t think it’s possible, because our Markdown editor is custom built and assembled from different components.
But can I ask you to provide me a little bit more context of what exactly you would like to build? As far as I understand, you would like to have many inputs within one field. Will changing content model help you? I.e, to not overload one field, you create a separate content type specifically for these inputs and add just common fields to the content type.

Thank you.

Hi @andrey.

I kind of glossed over the core challenge we’re facing.

We want to let content editors in our system create Articles. Typically, I think you’d create an article by having a long text field called “Page Body”, or something like that, and let the editor write their article using the Markdown editor.

This is fine if they’re just doing the basics… like images, headings, etc.

However, in addition to that, we want to let them insert custom modules into the page body. For instance, maybe they can insert a Slideshow, or an embedded Podcast, or just some custom styled block of text.

So a separate content type would work, but I’m not sure you’d actually array them on a page a particular order to build up the page content.

Hey @jason1 ,

Got your point. Thank you for the details.
Well, from the examples you mentioned- slideshows or other media content- I think it would be easier to add separate fields or create a reference field so to link to another content type.
Generally speaking, your case is one of the cases common scenarios for Contentful and I think it’s better to create separate fields and/or content types in such cases, because having all inputs in one field is more difficult to manage, less readable.
Feel free to share more details about your content model, i.e. what fields would you like to have, what content should be store- we’ll try to figure out what solution works better :wink:

Hey @andrey. We ended up doing what you suggested, just creating a “Relationship” field and composing the content of the page by linking in the various content types there. Thanks for the help.

@jason1 Glad it helped :wink:

Let me know if you need any other suggestions on this topic!