How to make file manager load in TinyMCE
If Flmngr does not load in TinyMCE, or if the editor does not load at all, you need to check your installation for correctness. Usually, you will see some messages in the browser console (press F12 in Chrome to open it), and the toolbar will not have the file manager buttons to upload, browse, and insert images, files, and galleries.
Check TinyMCE initialization code
First of all, you may have a syntax problem in the config. Please check the JS syntax inside the tinymce.init(..)
method.
If the syntax is fine, but the plugin is not loaded, you need to check whether you have correctly enumerated plugins inside the plugins
parameter. Note that if you have more than one plugin declared there, they should be comma separated without spaces.
Self-hosted TinyMCE plugin installation
If the plugin is still not loaded and in the browser console you see some messages related to unable to load the plugin.js
or plugin.min.js
file, this could mean the file is inaccessible. Check that you have really copied it into plugins/file-manager/
directory and the server allows reading it.
Example of external plugin initialization in self-hosted version of TinyMCE:
tinymce.init({
selector: '#editor',
plugins: 'image,link,file-manager',
});
Cloud TinyMCE plugin installation
If you are loading TinyMCE from a CDN you need to host Flmngr plugin somewhere on your website and specify the path to Flmngr using external_plugins
parameter.
This option allows you to specify a URL based location of plugins outside of the normal TinyMCE plugins directory. This property should be named after the plugin and should have a value that contains the location that the plugin that will be loaded from. Don't forget to also specify the name of the plugin in the plugins
parameter.
Example of external plugin initialization in cloud version of TinyMCE:
tinymce.init({
selector: '#editor',
external_plugins: {
'file-manager': 'https://your-host.com/path/to/file-manager/plugin.min.js'
},
plugins: 'image,link,file-manager',
});