在 TinyMCE(或 CKEditor)富文本编辑中覆盖主机

发布于 2024-12-28 22:05:03 字数 926 浏览 6 评论 0原文

我目前正在尝试将 RIch 文本编辑器集成到我正在开发的应用程序中。到目前为止,我已经测试了 CKEditorTinyMCE 编辑器。假设我的应用程序托管在 http://example.com 上。我的部署环境存在限制,导致无法提供静态资产。因此,静态资源使用不同的主机,即 http://assets.example.com< /a>.

我已经意识到 TinyMCE(以及 CKEditor)在我的 标签中动态附加

我的问题很简单:

  1. 是否有解决方案来覆盖 TinyMCE(或 CKEditor)使用的主机?
  2. 我应该在我的应用程序中使用哪些其他 RTE 来支持这种(实际上是软且常见的)约束。如果您有替代方案,我知道有很多 RTE 解决方案,我正在寻找一种现代且支持良好的解决方案,因为我知道大多数讨论 RTE 解决方案的帖子和网页都有 3 到 5 年以上的历史。

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

魂归处 2025-01-04 22:05:03

在tinymce中声明相对/绝对路径的方法有多种。
请查看此处的完整列表:http://www.tinymce.com/wiki.php/TinyMCE_FAQ#Paths.2FURLs_are_in Correct.2C_I_want_absolute.2Frelative_URLs.3F

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

迷离° 2025-01-04 22:05:03

在 CKEditor 中,您可以在加载主 ckeditor.js 文件之前声明 CKEDITOR_BASEPATH 变量,它将使用该变量作为其余文件的基础(尽管即使没有它,只要您没有这样做,它也会尝试自动检测该数据) t 压缩并合并该文件)
http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.html# .basePath

In CKEditor, you can declare the CKEDITOR_BASEPATH variable before loading the main ckeditor.js file and it will use that as the base for the rest of its files (although even without that it will try to detect that data automatically as long as you haven't compressed and merged that file)
http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.html#.basePath

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文