November Happy Hour will be moved to Thursday December 5th.

TinyMCE template plugin

Vote:
 

Hey Guys,

Has anyone been able to add the TinyMCE template plugin (https://www.tinymce.com/docs/plugins/template/) to EPiServer CMS 7.5 and define htm templates?

I've followed the instructions at http://world.episerver.com/documentation/Items/Developers-Guide/EPiServer-CMS/75/Editing/Customizing-the-TinyMCE-editor/ successfully, however when I click the template button there are no templates in the drop down list to select from.  I'm just not sure how to define the path to the .htm templates...  any ideas? I'm just trying to set the path to the same location as the plugin folder, i.e. /util/Editor/tinymce/plugins/template

I've tried a few different things in the Template.cs file as you can see below.

    [TinyMCEPluginButton(PlugInName = "template", 
        ButtonName = "template", 
        GroupName = "misc", 
        IconClass = "mceIcon mce_template")]
        // EditorInitConfigurationOptions = "{ templates : [{ title : 'Test Snippet', url : 'testSnippet.htm', description : 'MLA Test Snippet' }] }")]
    public class Template : IDynamicConfigurationOptions
    {
        public IDictionary GetConfigurationOptions()
        {
            var customSettings = new Dictionary();

            customSettings.Add("template_templates", "[{ title : \"Test Snippet\", url : \"testSnippet.htm\", description : \"MLA Test Snippet\" }]");
            customSettings.Add("template_external_list_url", "/");

            return customSettings;
        }
    }

Cheers

Mark

#142139
Dec 02, 2015 9:49
Vote:
 

So after a lot of trial and error I've managed to get this working with the following.

    [TinyMCEPluginButton(PlugInName = "template", 
        ButtonName = "template", 
        GroupName = "misc", 
        IconClass = "mceIcon mce_template",
    	EditorInitConfigurationOptions = "{ template_templates: [{ title : 'test', description : 'test', src : '../../util/editor/tinymce/plugins/template/templates/test.htm' }] }")]
    public class Template
    {
    }

Not sure how correct this is, but it's working atm.

Cheers

Mark

#142162
Dec 03, 2015 7:37
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* 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.