Hello!
I want to be able to define my templates in 2 separated files. I'm able to define those 2 files with the "config.templates_files" variable, but the "config.templates" variable doesn't seem to work. It only loads the first template set declared. In the documentation, it says :
Here is the code:
Inside the ckeditor_templates.js files, I have:
Thank you!
I want to be able to define my templates in 2 separated files. I'm able to define those 2 files with the "config.templates_files" variable, but the "config.templates" variable doesn't seem to work. It only loads the first template set declared. In the documentation, it says :
The templates definition set to use. It accepts a list of names separated by comma. It must match definitions loaded with the templates_files setting.But it doesn't work. I tried using an array instead but it didn't work either
Here is the code:
function CKEditorConfig(config) {
config.templates_files = [
'/bundles/basebackendcore/js/ckeditor_templates.js',
'/bundles/projectbackendcore/js/ckeditor_templates.js'
];
config.templates = 'default, project';
}Inside the ckeditor_templates.js files, I have:
CKEDITOR.addTemplates('default', {
// The name of the subfolder that contains the preview images of the templates.
imagesPath : '/bundles/basebackendtext/images/templates/',
// Template definitions.
templates :
[
// ...
]
});CKEDITOR.addTemplates('project', {
// The name of the subfolder that contains the preview images of the templates.
imagesPath : '/bundles/projectbackendtext/images/templates/',
// Template definitions.
templates :
[
//...
]
});Thank you!

Re: Multiple templates files not working
/* Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ CKEDITOR.addTemplates('default',{ imagesPath:CKEDITOR.getUrl(CKEDITOR.plugins.getPath('templates')+'templates/images/'), templates:[ { title:'Otra Plantilla', image:'template1.gif', description:'YUna plantilla sacada de la manga.', html:'<h1>El titulo va por aquí </h3><p>el texto por aquí</p><h2>Y otro titulo por aquí</h2>' }, { title:'Strange Template', image:'template2.gif', description:'A template that defines two colums, each one with a title, and some text.', html:'<table cellspacing="0" cellpadding="0" style="width:100%" border="0"><tr><td style="width:50%"><h3>Title 1</h3></td><td></td><td style="width:50%"><h3>Title 2</h3></td></tr><tr><td>Text 1</td><td></td><td>Text 2</td></tr></table><p>More text goes here.</p>' }, { title:'Text and Table', image:'template3.gif', description:'A title with some text and a table.', html:'<div style="width: 80%"><h3>Title goes here</h3><table style="width:150px;float: right" cellspacing="0" cellpadding="0" border="1"><caption style="border:solid 1px black"><strong>Table title</strong></caption></tr><tr><td> </td><td> </td><td> </td></tr><tr><td> </td><td> </td><td> </td></tr><tr><td> </td><td> </td><td> </td></tr></table><p>Type the text here</p></div>' }, { title:'MyTemplateHere', image:'template1.gif', description:'Only Title.', html:'<h1>One Title...</h1>' } ]});Re: Multiple templates sets not working
Re: Multiple templates sets not working
CKEDITOR.editorConfig = function( config ) { // Define changes to default configuration here. For example: // config.language = 'fr'; // config.uiColor = '#AADC6E'; //Cargar ficheros externos con las plantillas que queramos config.templates_files=['/ckEditorWEB/plantillas/miplantilla.js','/ckEditorWEB/ckeditor/plugins/templates/templates/default.js']; config.templates='miplantilla,default'; };Multiple template files
I have this issue, did you ever manage to resolve it please?
Steve
Multiple template files
I have this issue, did you ever manage to resolve it please?
Steve