How can I add Custom Plugin to tinymce.v4
See original GitHub issueI am using tinymce version4 with vue js , after i follow tinymce official documentations and implementd in my project i get error field to load "../plugins/example/plugin.js"
so here is my code
<template>
<div class="container">
<h2 class="">Tinymce-Vue</h2>
<editor id="app-editor"
api-key="jh5j9j89wyv5mbctvucc67e0o5ba3q7v4xkldjfoaqv74glt"
:init="inital"
v-model="content">
</editor>
</div>
</template>
<script>
import editor from '@tinymce/tinymce-vue';
import tinymceConfig from './config/tinymce';
export default {
data(){
return {
content: '',
}
},
components: {
editor
},
computed: {
inital(){
return tinymceConfig.config;
}
}
}
</script>
and config.js file look like so …
const config = {
select: "#app-editor",
plugins:"wordcount example",
toolbar1: "wordcount | example",
external_plugins: {
example: "../plugins/example/plugin.js",
},
}
export default {config};
and plugin.js file also look like so :
tinymce.create('tinymce.plugins.
init: function(editor, url) {
editor.addButton( 'example', {
text: 'example',
icon: false,
type: 'menubutton',
menu: [
{
text: 'Menu 1',
onclick:function() {
alert("I am Menu 1);
}
},
{
text: 'Menu 2',
onclick: function() {
alert("I am Menu 2);
}
}
]
});
},
createControl: function() {
return null
},
tinymce.PluginManager.add('example', tinymce.plugins.example)
so how to fix it…
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Create a plugin for TinyMCE
Register a custom plugin with TinyMCE using the PluginManager. PluginManager.add() takes a string for the plugin identifier and a function that contains the ......
Read more >Create a Plugin for TinyMCE
To create a plugin, you need to create a directory in the TinyMCE plugins directory. TinyMCE will load the plugin.js file if you...
Read more >Creating a plugin - TinyMCE
There is an example plugin that is made to be easy to modify and has the basic things you need for a custom...
Read more >tinymce.Plugin | Docs
This is a pseudo class that describes how to create a custom plugin for TinyMCE. A custom plugin registered using PluginManager.add should either...
Read more >Create a plugin for a text editor - TinyMCE
How to implement your TinyMCE plug-in · Download TinyMCE · Set up the website · Create a plug-in · Add the plug-in to...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Thank you very much @lnewson to help me understand this issue as I expected.
@OmdaMukhtar the docs for external plugins is here: https://www.tiny.cloud/docs-4x/configure/integration-and-setup/#external_plugins The purpose of it is when you want to load a plugin that’s outside the normal
pluginsdirectory or when it isn’t bundled as part of your application. Custom plugins generally fall into this category, which is why you’ve probably seen it suggested before.