Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
ckeditor: Templates
#1
Hi, I need templates in ckeditor.
I managed to display the link in the Editors Functions Bar, but when I cklick the screen freezes.
I guess I need do add support for it in the ckeditor - any ideas how to accomplish this?

your's
felix
Reply
#2
Felix,

I did include templates in our editor at get-simple.de and it works
I think I once described how to do it,

in the custom config-file I activated the template-plugin

Code:
CKEDITOR.editorConfig = function( config )
{
    .....
    config.extraPlugins = 'fileicon,video,syntaxhighlight','templates',
...
    };

in /admin/template/js/ckeditor/plugins/templates/templates/default.js I defined like this:

Code:
// Register a template definition set named "default".
CKEDITOR.addTemplates( 'default',
{
    // The name of the subfolder that contains the preview images of the templates.
    imagesPath : CKEDITOR.getUrl( CKEDITOR.plugins.getPath( 'templates' ) + 'templates/images/' ),

    // Template definitions.
    templates :
        [
            {
                title: 'Hinweis',
                image: 'lightbulb.gif',
                description: 'Hinweis mit Glühbirne',
                html:
                    '<p class="hinweis"><strong>' + '<img alt="enlightened" class="ohne-border" height="20" src="http://www.get-simple.de/...../lightbulb.gif" title="enlightened" width="20" /> Hinweis</strong>: Überschreibe diesenText.' + '</p>'
            },
            {
                title: 'In der Presse',
                image: 'newspaper.png',
                description: 'Für die Presseliste',
                html:
                    '<H2>ÜberschreibediesenTextmitTitel</h2>' + '<p>LinkzuArtikel</p>'
            },
            
            
            {
                title: 'DefinitionList',
                image: 'definitionlist.gif',
                description: 'Zum Erzeugen von Definition-Listen.',
                html:
                    '<dl>' + '<dt>Begriff' + '<dd>Erklärung</dd>' + '</dl>'
            },
            {
                title: 'Definitionlisten-Eintrag',
                image: 'definitionlist.gif',
                description: 'Um weitere Definitionen einzufügen',
                html:
                    '<dt>nochein Begriff' +
                    '<dd>noch eine Erklärung</dd' + '</dt>'
            }
            
        ]
});

and it works

Code:
{
                title: ' ',
                image: ' .',
                description: '',
                html:
                    '  '</p>'
            },

defines one template
|--

Das deutschsprachige GetSimple-(Unter-)Forum:   http://get-simple.info/forums/forumdisplay.php?fid=18
Reply
#3
Thanks a lot for your quick response!
I first - however - had to upload the template plugin from a full ckeditor package.
Then I changed the ckeditor's config.js as you wrote.
Now it works fine.
your's
felix
Reply




Users browsing this thread: 1 Guest(s)