是否可以在不编辑站点包中的模板插件文件的情况下向 django CKEditor 添加模板?
Is it possible to add a temlate to django CKEditor without editing it's templates-plugin files in site-packages?
lib/python3.6/site-packages/ckeditor/static/ckeditor/ckeditor/plugins/templates/templates/default.js
中有一个文件,我可以编辑它以将更多模板添加到我的 RichTextFields。但我真的很想用 git 跟踪这些变化,我不想将我的环境添加到 git。
有没有办法自定义,将模板添加到 django ckeditor 的 模板插件?
我不能告诉你很多关于 Dijango CKEditor 的信息,但是可以使用 https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_config.html#cfg-templates and https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_config.html#cfg-templates_files 配置设置向 CKEditor 添加多个模板文件。请看下面:
var editor = CKEDITOR.replace( 'editor1', {
language: 'en'
templates_files : [
'/ckeditor/plugins/templates/templates/default.js',
'/ckeditor/my_templates.js'
],
templates : 'default,my_templates'
});
也请看看:CKEditor - how to get the template attributes
lib/python3.6/site-packages/ckeditor/static/ckeditor/ckeditor/plugins/templates/templates/default.js
中有一个文件,我可以编辑它以将更多模板添加到我的 RichTextFields。但我真的很想用 git 跟踪这些变化,我不想将我的环境添加到 git。
有没有办法自定义,将模板添加到 django ckeditor 的 模板插件?
我不能告诉你很多关于 Dijango CKEditor 的信息,但是可以使用 https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_config.html#cfg-templates and https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_config.html#cfg-templates_files 配置设置向 CKEditor 添加多个模板文件。请看下面:
var editor = CKEDITOR.replace( 'editor1', {
language: 'en'
templates_files : [
'/ckeditor/plugins/templates/templates/default.js',
'/ckeditor/my_templates.js'
],
templates : 'default,my_templates'
});
也请看看:CKEditor - how to get the template attributes