Try our conversational search powered by Generative AI!

From the TinyMCE editor object, how do I load a named settings configuration?


How do I load TinyMCE using custom settings?  I have created a custom configuration called "Comment Editor."  I want to load this in my template.  I have this code, which works:

var editor = new Editor.TinyMCE.Editor();
            editor.PropertySettings = (TinyMCESettings) CurrentPage.Property[0].GetSetting(typeof (TinyMCESettings));


But this loads the default settings, not my custom, named settings.  I can't figure out how to get at my named settings.

Nov 19, 2012 15:17

Have you tried GetGlobals() to find the correct one?

var p = new PropertySettingsRepository();
var globals = p.GetGlobals(typeof( ...


Edited, Nov 19, 2012 17:21

I'm still fuzzy on how that gets me a named property setting...

Nov 19, 2012 17:28
foreach (var setting in globals)
        if (setting.DisplayName.Equals("Comment Editor", StringComparison.OrdinalIgnoreCase))


Nov 19, 2012 17:30

I actually found another way around it.  I create an new empty page of the Comment type, then pull the settings off the property I wanted.

That probably makes sense, since those settings are bound to that property.  I do have a PageData object that I just throw away without saving, but I can't see how that's a problem.

editor.PropertySettings = (TinyMCESettings)comment.Property["MainBody"].GetSetting(typeof (TinyMCESettings);


Nov 19, 2012 19:02

Is there a way you could do the same with PageTypeBuilder? I mean just select the default settings for TinyMCE without creating the settings in code?

Edited, Feb 20, 2013 10:58

So, on startup you want anything that's not the Default setting to be set back to the Default setting?
Or do you want all Setttings gone and revert to the out-of-the-box EPiServer config?

The out-of-the-box toolbars are not optimal IMHO so I need an "own" setting anyway... Blogged about it a while back:

Edited, Feb 20, 2013 11:25
This thread is locked and should be used for reference only. Please use the Episerver CMS 7 and earlier versions forum to open new discussions.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.