2

我为ckeditor声明配置如下:

var ckconfig  = {
    uiColor: '#ffffff',
    stylesCombo_stylesSet: [],
    format_tags: "p;h2;h3;h4;div",
    contentsCss : '/js/admin/editorstyles/default.css',
    extraPlugins : 'stylesheetparser',
    scayt_autoStartup:true,
    toolbar_Full: [['Templates','Styles','Format','FontSize','TextColor', 'Bold', 'Italic', 'Underline','-', 'NumberedList', 'BulletedList','-','Scayt','PasteText'],
    ['Image','Link', 'Unlink'], ['Undo', 'Redo'],['Source', 'Maximize', 'ShowBlocks']] 
}

并启动为

$('textarea#b_description').ckeditor(ckconfig);

这很好,但我将如何使用此符号添加自定义模板文件?

4

1 回答 1

3

如果您进入 ckeditor/plugins/templates/templates/default.js(基于版本 3.6.2 的文件结构),您将看到模板的定义。

使用此页面作为指南 - http://docs.cksource.com/CKEditor_3.x/Developers_Guide/Templates - 您应该能够完成创建新模板所需的任何事情。

您可以使用以下符号在 config.js 文件中声明要使用的模板文件的显式列表:

config.templates_files = [ '/mytemplates.js' ];

对于您的特定符号,该行将是:

templates_files: [ '/mytemplates1.js', '/mytemplates2.js' ]
于 2012-09-14T21:37:32.160 回答