dedecms5.7中的ckeditor遇到的一些问题以及解决办法

更新时间:2023-03-16 20:40:01 阅读量: 教育文库 文档下载

说明:文章内容仅供预览,部分内容可能不全。下载后的文档,内容与下面显示的完全一致。下载之前请确认下面内容是否您想要的,是否完整无缺。

使用Dedecms5.7中的ckeditor时遇到的一些问题及解决办法:

1、 ckeditor添加字体:

打开include/ckeditor/ckeditor.js,搜索font_names,找到字体列表。添加所需的中文字体,添加后为:

i.font_names='Arial/Arial, Helvetica, sans-serif;Comic Sans MS/Comic Sans MS, cursive;Courier New/Courier New, Courier, monospace;Georgia/Georgia, serif;Lucida Sans Unicode/Lucida Sans Unicode, Lucida Grande, sans-serif;Tahoma/Tahoma, Geneva, sans-serif;Times New Roman/Times New Roman, Times, serif;Trebuchet MS/Trebuchet MS, Helvetica, sans-serif;Verdana/Verdana, Geneva, sans-serif;宋体/宋体;黑体/黑体;仿宋/仿宋_GB2312;楷体/楷体_GB2312;隶书/隶书;幼圆/幼圆;微软雅黑/微软雅黑';

需要特别注意的是:添加的字体,要写成诸如“宋体/宋体”的形式,而不是“宋体”。即“显示的字体名称/实际字体名称”的格式。 2、 添加行距按钮:

(1)下载ckeditor的行距插件包(网上很容易找到的)并解压到ckeditor/plugins目录下; (2)由于dedecms 5.7自己集成了一个dedepage插件,用来添加ckeditor自定义插件,在/include/ckeditor/plugins/dedepage文件夹下,打开plugin.js文件在最后面添加:requires : [ 'lineheight' ];

(3) 修改/include/ckeditor/ckeditor.inc.php文件,在$toolbar['Basic'] 的最后一行添加元素Code,修改后代码如下:

$toolbar['Basic'] = array(

array( 'Source','-','Templates'),

array( 'Cut','Copy','Paste','PasteText','PasteFromWord','-','Print'), array( 'Undo','Redo','-','Find','Replace','-','SelectAll','RemoveFormat'), array( 'ShowBlocks'),array('Image','Flash','Addon'),array('Maximize'),'/', array( 'Bold','Italic','Underline','Strike','-'),

array( 'NumberedList','BulletedList','-','Outdent','Indent','Blockquote'), array( 'JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'), array( 'Table','HorizontalRule','Smiley','SpecialChar'), array( 'Link','Unlink','Anchor'),'/',

array( 'Styles','Format','Font','FontSize'),

array( 'TextColor', 'BGColor', 'MyPage','MultiPic'), array( 'lineheight') );

来源参考:http://ljty11.blog.163.com/blog/static/109194141201271651632139/ 3、 文章编辑器的工具菜单栏的附件上传图标按钮不显示:

打开include/ckeditor/plugins/addon/plugin.js找到以下代码:

// Register the toolbar button. editor.ui.addButton( 'Addon', {

label : '附件',

icon : 'http://desdevcms.com/images/addon.gif', command : pluginName });

将上面的icon路径改为/include/ckeditor/images/addon.gif即可。

4、 多图发布功能按钮乱码:

打开\\include\\ckeditor\\plugins\\multipic\\plugin.js 把该插件的js文件另存为UTF-8编码格式。 参考:http://www.antcome.com/dedecms/plugin.html

本文来源:https://www.bwwdw.com/article/0auv.html

Top