1

Is there a rich text editor for Craft CMS which supports both HTML source code edit as well as adding images by URL (not uploading to assets)?

2

You can do it with Redactor.

You can configure your toolbar to have a view HTML button.

Also, a caveat, Redactor has an html-purifier function, which will eat some bits of code in the name of making it "clean." But that's relatively easy to configure as well. Just make sure to look at the plugin documentation.

  • I cannot see any way how to configure the toolbar to include an "insert image by URL" button. The only way I see to add such image is in the source code which is note suitable for regular CMS users. – Michal Jan 13 at 10:23
  • Look at this bit of their github instructions - github.com/craftcms/redactor#configuration - Basically, you create different toolbars in a redactor config file, and then when you're making a field in craft, you say field type = redactor. redactor settings = standard, etc. Try copying the Standard.json file they have in this example, as it's got the HTML button that you want. – SamC Jan 13 at 17:43
  • But I'm not looking for the HTML source button, I'm missing the "insert image from URL" button. – Michal Jan 14 at 18:37
  • AH. I assumed you'd just look at the html and type in <img src="outside-img-url"> to point at your image. Doesn't look like the redactor will let you add such a button (add external image) without writing a plugin. so, maybe that's not the plugin for you. – SamC Jan 14 at 20:15
  • FWIW, when I make content areas for articles/long-text, I do a matrix field w/ different layout blocks. (full width text; text left, image right; full width image; etc) Then it's a bunch of blocks, each formatted nicely. And an external image field could just be a text field (or URL field) where you copy and paste in your image link. And then you could wrap it in whatever html you needed, and even check if the image was valid. It's more complex, but it's also more control. – SamC Jan 14 at 20:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.