November Happy Hour will be moved to Thursday December 5th.
November Happy Hour will be moved to Thursday December 5th.
The way this is supposed to be done is using a plugin with a plug-in attribute with these settings. Here you can find some information http://world.episerver.com/Documentation/Items/Tech-Notes/EPiServer-CMS-6/EPiServer-CMS-6-RC1/Adding-a-TinyMCE-Plug-in/ Note the EditorInitConfigurationOptions attribute property.
That means you set up a property on the plugin attribute with a string (JSON notation) with all the editor properties you want to be set. with some properties there is some functionality for merging the result (like extended_valid_elements) but most should just replace. You might get some conflict warnings and such too I think.
And if you want the settings for some properties and for some not you just use the property settings functionality to enable your plugin on some properties.
Thanks! Seems to work great.
I put a working plugin code example on my blog:
http://krompaco.nu/alter-default-initoptions-for-tinymce-in-episerver-6/
JSON-deserializing fails when you try to add more advanced config such as:
http://wiki.moxiecode.com/index.php/TinyMCE:Configuration/class_filter
Invalid JSON primitive: function. System.Web.Script.Serialization.JavaScriptObjectDeserializer.DeserializePrimitiveObject()
Have tried multiptle ways of escaping the function without any luck...
Yes I can see that that might be a problem.
The thing you might be able to do is inserting the function itself elsewhere like
var myFilterFunction = function()... (for test just create it in some system.js or something)
and then in the JSON just enter myFilterFunction. Then you would not need all that code in the JSON string.
But anyhow this might be considred a bug so opening a support ticket to episerver support might be a good thing too.
You should be able to add the class_filter setting from your plugin doing something like this:
(function() {
tinymce.create('tinymce.plugins.classFilter', {
init: function(ed, url) {
ed.settings.class_filter = function(cls, rule) {
if (cls !== 'test') { return true; }
else { return false; }
};
}
});
tinymce.PluginManager.add('classFilter', tinymce.plugins.classFilter);
})();
and then registering it as AlwaysEnabled:
[TinyMCEPluginNonVisual(AlwaysEnabled = true, PlugInName = "classFilter")]
public class ClassFilter
{
}
What's an easy way to affect these options for editor instances for a property in Edit mode?
Been reflecting but can't seem to find the right spot when I don't have the control-markup at hand. We wan't to change skin and add valid_elements and some other options.