文章来源:http://www.imtr.cn/html/n155.html
由于织梦后台默认编辑器功能上的缺憾,使得在添加文章的时候,需要借用第三方编辑软件,对文章进行格式,然后再粘贴进织梦编辑器中。
我们可以用百度的Ueditor编辑器来替换之,实现我们想要的结果。
下面是如何利用百度的(Ueditor)编辑器替换dede自带的编辑器步骤:
延伸阅读:织梦整合百度(UEditor)编辑器,栏目内容、单页无法保存的bug处理方法
一、下载百度编辑器
百度编辑器有“开发版”和“Mini版”两种,我们使用开发版来进行整合,开发版共有4中语言版本,分别是“PHP”“Asp”“.Net”“Jsp”,每种语言又分为 GTF-8 和 GBK 两种版本,织梦用的是PHP语言,所以我们只需要根据你目前的织梦编码下载UTF-8或GBK即可。
百度(UEditor)编辑器版本 1.4.3.3,选择适合您的版本下载
PHP 版 | UTF-8版 | GBK版 |
Asp 版 | UTF-8版 | GBK版 |
.Net 版 | UTF-8版 | GBK版 |
Jsp 版 | UTF-8版 | GBK版 |
或者去官网下载 官网地址:http://ueditor.baidu.com
解压后得到这样的一个文件夹,复制全部内容
二、把Ueditor放进DedeCMS程序
打开织梦根目录下的include,新建一个文件夹并命名为ueditor,复制百度编辑器的全部文件到ueditor文件夹中
三、修改inc_func_funcAdmin.php
打开/include/inc/目录下的inc_fun_funAdmin.php文件
找到大概第185行的else if($GLOBALS['cfg_html_editor']=='ckeditor'),在上面一行加入代码:
// 百度编辑器 else if($GLOBALS['cfg_html_editor']=='ueditor') { $fvalue = $fvalue==''?'<p></p>':$fvalue; $code = ' <script type="text/javascript" charset="utf-8" src="/include/ueditor/ueditor.config.js"></script> <script type="text/javascript" charset="utf-8" src="/include/ueditor/ueditor.all.js"></script> <link rel="stylesheet" type="text/css" href="/include/ueditor/themes/default/css/ueditor.css"/> <script name="'.$fname.'" id="'.$fname.'" style="width:99.8%;">'.$fvalue.'</script> <script type="text/javascript">var ue = new baidu.editor.ui.Editor();ue.render("'.$fname.'");</script>'; if($gtype=="print") { echo $code; }else{ return $code; } } // 百度编辑器
四、登录织梦后台修改配置信息
“基本参数设置”--“核心设置”--“Html编辑器”修改为ueditor
整合完成,开始使用百度ueditor编辑器吧。
原文地址:http://www.imtr.cn/html/n155.html