Search code examples
javascripthtmltinymceckeditorrte

Override host in TinyMCE (or CKEditor) Rich Text Edit


I am currently trying to integrate a RIch Text Editor in an application I am working on. So far, I have tested CKEditor and TinyMCE editor. Assume my application is hosted at http://example.com. I have a constraint in my deployment environment that makes it impossible to serve static assets. For this reason, static assets use a different host which is http://assets.example.com.

I have realized that TinyMCE (as well as CKEditor) dynamically appends <script> tags in my <head>tag. However both use absolute path based on http://example.com, therefore they don't work in production for my environment where all static assets are hosted by http://assets.example.com.

My question is simple:

  1. Is there a solution to override the host used by TinyMCE (or CKEditor) ?
  2. What other RTE should I use in my app that support such a (actually soft and common) constraint. In case you have an alternative, I know there are a lot of RTE solutions out there, by I am looking for a modern and well supported one, as I understand that most posts and webpages talking about RTE solutions are 3 to 5+ years old.

Solution

  • There are various ways how to declare relative/absolte paths in tinymce. Have a look here for a full list: http://www.tinymce.com/wiki.php/TinyMCE_FAQ#Paths.2FURLs_are_incorrect.2C_I_want_absolute.2Frelative_URLs.3F