I would like to add a TinyMCE plugin inside an Episerver add-on.
The add-on itself works just fine, and it properly registers the TinyMCE plugin like so (additional attribute parameters excluded for brevity):
[TinyMCEPluginNonVisual(PlugInName = "mycustomplugin")]
public class MyCustomTinyMcePlugin
However, the plugin itself fails to load. Episerver simply returns a 404 when trying to get the plugin from: /Util/Editor/tinymce/plugins/mycustomplugin/editor_plugin.js
My add-on is contained within a zip file, which in turn contains the TinyMCE plugin.
However, this doesn't help as the TinyMCE editor always loads plugins from:
Is there any way to make files in my add-on available under the /Util path, or is there some other clever way of enabling the plugin?
I would like to avoid registering a VirtualPathProvider, as my add-on won't be able to tell what the actual path will be (the add-on is supposed to be re-usable).
Any tips or pointers are greatly appreciated! :)
For now I'll just do something like this in an IHttpInitializableModule in the add-on assembly (this way the plugin script file will be served by the VPP automatically registered for the add-on zip file):
public void InitializeHttpEvents(HttpApplication application)
application.BeginRequest += RewritePluginPath;
private void RewritePluginPath(object sender, EventArgs e)
const string pluginFolderPath = "/Util/Editor/tinymce/plugins/mycustomplugin/editor_plugin.js";