可以在 Joomla 中升级 Tinymce 到 v5.x 吗?

huangapple go评论53阅读模式
英文:

Is it possible to upgrade Tinymce to v5.x in Joomla?

问题

当前最新的Joomla!版本是3.9.14(2019年8月)

集成的Tinymce版本是4.5.11

Tinymce于2019年2月发布了新的版本5.0.0,包括重大改进和全新的API

我想在Joomla!中使用一个使用新的V5 API编写的插件,所以我想知道是否可以将Tinymce升级到V5,还是我们别无选择,只能继续使用旧的丑陋的Tinymce V4.x?

我尝试替换/编辑media/editors/tinymce中的文件,只是为了看看是否能有所进展,但当然似乎不是正确的方向。

英文:

The current latest Joomla! v3.9.14 (August 2019)

The integrated tinymce is v4.5.11

Tinymce released the new V.5.0.0 in February 2019, including major improvements and a great new API

I want to use a plugin written with the new V5 API in Joomla!, so I wondered if it's possible to upgrade Tinymce to V5 in Joomla, or if we have no choice but to still use the old ugly Tinymce v4.x?

I tried to replace/edit files in media/editors/tinymce, just to see if it could lead to something, but of course it doesn't seem to be the right direction.

答案1

得分: 3

不要替换文件(它们可能会在任何将来的更新中被覆盖),你可能最好是为 Joomla 编写一个新的插件来安装 Tiny 5。

TinyMCE 插件的源代码(v4)是开始编写自己插件的好地方 - 复制此插件的工作方式,并且你需要扩展其功能。

以这种方式进行还意味着你可以选择使用 Tiny 的云版本,这意味着你不需要在本地托管文件,并且可以在 Tiny 推送更新时收到更新。对此,你需要一个 Tiny API 密钥,但我认为这是更智能的托管 Tiny 的方式,因为即使在 2019 年 Tiny 5 的生命周期中,一些非常有用的功能也已经部署了,如果你自己托管所有文件,就需要随着时间的推移不断进行更新。

编写自己的 Tiny 5 Joomla 插件的挑战在于 Joomla 的核心 TinyMCE 插件不允许外部托管的 Tiny 插件(比如你创建的自定义插件)。因此,你需要扩展配置和实例化,以能够存储外部插件配置,将其引入到 Tiny 的配置中,并能够管理工具栏。

在 Joomla Day Australia 2019 上,我谈到了在 Joomla 4 中开发 Tiny 5 的外部插件,并且有一个使用 Tiny 的云版本,并允许外部插件配置的插件 - 但这是针对 Joomla 4 的 alpha 版本。

Joomla 4 将提供 Tiny 5,并且我已经提交了一个拉取请求,将外部插件加入到编辑器配置中,所以只需等待 Joomla 4 可能是一种更被动的选择。

英文:

Rather than replacing the files (which could be overwritten in any future update), you're probably better off writing a new plugin for Joomla that installs Tiny 5.

The source code for the (v4) TinyMCE plugin is a good place to start to write your own - replicate how this plugin works, and you'll need to extend its functionality.

Doing it this way also means you could choose to use the Cloud version of Tiny, meaning you don't need to host the files locally, and receive updates as Tiny push them live. You do need a Tiny API key for this, but IMO, I feel it is a smarter way to host Tiny given that even during 5's life in 2019, some really useful features have been deployed, and if you're hosting all the files yourself, you'll need to keep updating them as you go.

The challenge with writing your own Tiny 5 Joomla plugin is that the core TinyMCE plugin for Joomla does not make it possible to have externally hosted Tiny plugins (such as a custom one you've created). So you would need to extend both the configuration and the instantiation to be able to store external plugin configuration, pull it in to Tiny's config, and also be able to manage your toolbars.

At Joomla Day Australia 2019 I spoke about developing external plugins for Tiny 5 in Joomla 4, and have a plugin that uses the cloud version of Tiny, and allows for external plugin configuration - but this was for an alpha version of Joomla 4.

Joomla 4 will come with Tiny 5, and I did a pull request to get external plugins in to the Editor config, so just waiting for Joomla 4 could be a more passive option.

huangapple
  • 本文由 发表于 2020年1月4日 01:26:04
  • 转载请务必保留本文链接:https://go.coder-hub.com/59582787.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定