Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more

Adding Custom External plugins to TinyMce 4.4.4

Vote:
 

Hello All,

Looking for help on adding external custom plugins to TinyMce 4.4. version. I am not seeing any online resource that has the details.

Thanks,

#310630
Oct 11, 2023 13:29
- Oct 16, 2023 7:05
You can use external_plugins option to specify the url of your custom plugin, or copy the content of your external plugin to Plugins folder for tinymce
Vote:
 

I have a custom javascript which am trying to load as an external plugin. The javascript uses below format to add the plugin. I am not able to find if this is still a valid way to add external plugin.

tinymce.PluginManager.add('metricconvert', function (editor, url) {}

#310913
Oct 16, 2023 13:51
Vote:
 

See the docs here: https://docs.developers.optimizely.com/content-management-system/docs/plug-ins#add-a-tinymce-plug-in

services.Configure<TinyMceConfiguration>(config =>
    {
        config.Default()
        .AddExternalPlugin("custom-plugin", "alloy/plugins/custom-plugin.js");
    });
#311075
Oct 18, 2023 19:11
Vote:
 

Finally found that the issue was the custom plugin (JS file) itself. With the new version of TinyMce the custom plugin implementation is updated.

Before:

editor.addButton('metricconvert') and using onClick function

Latest Implementation: Use below format and replace onClick to onAction.

    editor.ui.registry.addButton('metricconvert', {
        text: 'Metric Convert',
        onAction: function () {

More details available here : https://blogs.perficient.com/2023/10/26/adding-custom-external-plugin-to-tinymce/

#311508
Edited, Oct 26, 2023 13:43
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.