Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more

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

Vote:
0

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.

#63409
Nov 19, 2012 15:17
Vote:
0

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

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

    

#63414
Edited, Nov 19, 2012 17:21
Vote:
0

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

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

    

#63419
Nov 19, 2012 17:30
Vote:
0

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);

    

#63429
Nov 19, 2012 19:02
Vote:
0

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?

#66102
Edited, Feb 20, 2013 10:58
Vote:
0

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:
http://krompaco.nu/2012/09/page-type-builder-and-tinymce-global-settings/

#66104
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.