External images in Rich Text fields?

So I gather that rich text fields can only include images from the Media Library, not external images?

We have lots of existing rich text content with images hosted elsewhere, and ideally we would just copy and paste this content into a rich text field. I know we can use slices to support the external images, but this will greatly increase the labor involved in porting this content. Just wondering if I'm missing something.

Thanks!

Hi @jeremy2,

Your understanding is correct: rich text fields can only include images from the media library. I can think of a few workarounds that might work (though I haven't tested them), but none of them do exactly what you're describing.

The most standard approach would be to use Prismic's import feature. That would require formatting your content for an import. If you import images hosted elsewhere, the importer will download the file to your repository's media library. (More info on importing images.) This is a good option, because your images would benefit from our Imgix compression, and you'd be able to access them again in the media library.

Another option could be to extract the image URL from the img element before adding it to Prismic. Then, in the editor, give the url a custom label in the rich text editor. Then, in your HTML Serializer, use that label to wrap the URL in a new img element.

I recognize that neither of these options do what you're asking — and they might not save any time — but I thought I'd let you know what some alternative possibilities are. In the end, I imagine it will likely make sense to go with the slice method, as you originally said.

Sam

This issue has been closed due to inactivity. Flag to reopen.