Edit block from TinyMCE

Member since: 2004


I've created a TinyMCE plugin that creates a block and adds the block-markup to the editor, which works just fine. However the block should be editable in the same way (select the block and press the button in the toolbar). Since the block-markup has the class "epicontentfragment", EPiServer seems to disable all toolbar options. Is there a way to override this? Or do I need to reconsider my implementation..?

Thanks in advance.

#140893 Nov 03, 2015 10:30
  • Member since: 2002

    EPiServer has a plug-in named epicontentfragment which will trigger on elements with the class "epicontentfragment". This plug-in (found at [version]ClientResources\editor\tiny_mce\plugins\epicontentfragment\editor_plugin_src.js) does not directly do anything but rather sets the non-editable class used by the Tiny MCE plug-in Non-editable (http://www.tinymce.com/wiki.php/Plugin:noneditable).

    I'm not sure if it's possible to bypass this and if so: how to bypass it but I would suggest taking a look at the documentation for this. Please note that the link provided is to the Tiny MCE 4.x API since I could not find the documentation for 3.x which EPiServer is using, so there might have been changes.

    #141014 Nov 06, 2015 12:23
  • Member since: 2004

    Thanks Linus! I've debugged some more and it seems like epicontentfragment has some configuration-settings that tells which buttons are allowed to be enabled.

    [TinyMCEPluginNonVisual(LanguagePath="/admin/tinymce/plugins/epicontentfragment/epicontentfragment", PlugInName="epicontentfragment", AlwaysEnabled=true, ServerSideOnly=true, EditorInitConfigurationOptions="{epicontentfragment_enabledcontrols: 'epipersonalizedcontent, code, undo, redo, cut, copy, fullscreen'}")]

    I guess it might be a problem to override that setting. :/

    #141029 Nov 06, 2015 15:30