Developer forum

Forum » Feature requests » New Text Editor with no Editor Templates

New Text Editor with no Editor Templates

Diogo Brito
Reply

Hi there,

With IE11 putting an end to the "old" text editor, the new one lack the option to pré configure Editor Templates. I have noticed that the new editor has a addon for that:
http://ckeditor.com/addon/templates

The problem is, if I include the addon myself, i will have to review it every time the CMS is updated.

Is there any chance this addon is included by "default" in the Dynamicweb versions?

Best Regards,
Diogo Brito


Replies

 
Kenneth Radoor
Reply

hi

It can be done as it is to day

Locate you editor config-files in /Files/System/Editor/ckeditor/config

in one of the config files add the fellowing:

    config.templates_files = ['/Files/System/Editor/ckeditor/templates/MyTemplates.js'];
    config.templates = 'myTemplates';

add a new folder to /Files/System/Editor/ckeditor/ called MyTemplates.js

in this file add something like

CKEDITOR.addTemplates("myTemplates", {
    imagesPath: CKEDITOR.getUrl("/Files/System/Editor/ckeditor/templates/images/"), templates:
        [{
            title: "Image and Title", image: "template1.gif", description: "One main image with a title and text that surround the image.",
            html: '<h3><img style="margin-right: 10px" height="100" width="100" align="left"/>Type the title here</h3><p>Type the text here</p>'
        },
        {
            title: "Colored link box", image: "template4.gif", description: "Edit link and text",
            html: '<ul class="editor-inline-link-box"><li><a href="#"><i class="fa fa-caret-right ">&nbsp;</i>Link_text</a></li></ul>'
        }
        ]
});

Now you can make all the templates you desire :)

 

/Kenneth