dedecms自带的ckeditor编辑器有些地方有局限性,特别对于需要在文章中插入代码的网站,织梦自带的ckeditor编辑器不怎么方便,不过还好有百度开发的Ueditor编辑器,相比织梦自带的ckeditor编辑器,百度Ueditor编辑器功能比较丰富,那么下面深山seo就教大家如何给织梦网站换上百度Ueditor编辑器。
1.下载对应版本的ueditor
在百度ueditor官网 下载跟织梦CMS相对应版本的ueditor源码(GBK或者UTF8)。
2.下载下来之后解压出来,解压应该都会吧?
3.解压出来之后我们把它改名为ueditor;
4.将ueditor上传到织梦网站的 /include目录下;
5.修改/include/inc/inc_fun_funAdmin.php文件,找到185行,贴入以下代码。
else if($GLOBALS['cfg_html_editor']=='ueditor')
{
$fvalue = $fvalue=='' ? '<p></p>' : $fvalue;
$code = '<script type="text/javascript" charset="utf-8" src="'.$GLOBALS['cfg_cmspath'].'/include/ueditor/ueditor.config.js"></script>
<script type="text/javascript" charset="utf-8" src="'.$GLOBALS['cfg_cmspath'].'/include/ueditor/ueditor.all.min.js"></script>
<link rel="stylesheet" type="text/css" href="'.$GLOBALS['cfg_cmspath'].'/include/ueditor/themes/default/css/ueditor.min.css"/>
<textarea name="'.$fname.'" id="'.$fname.'" style="width:100%;">'.$fvalue.'</textarea>
<script type="text/javascript">var ue = new baidu.editor.ui.Editor({initialFrameHeight:400});ue.render("'.$fname.'");</script>';
if($gtype=="print")
{
echo $code;
}
else
{
return $code;
}
}
6.登录织梦后台修改相应的设置;进入织梦网站后台-->系统-->系统基本参数-->核心设置-->将Html编辑器的值改为ueditor,然后点击最下方的【确定】按钮保存。
至此,百度Ueditor编辑器已经安装完成,快去发一篇文章试试吧,安装完成之后的百度Ueditor编辑器截图如下:
文章的最后,深山seo跟大家说声抱歉,因为图片的大小问题导致图片不清晰,看得不是很清楚,但是以上都是深山seo实践之后的截图,确实可用才分享出来的,祝大家都能学会如何给织梦网站换上百度ueditor编辑器!
原标题:如何给织梦网站换上百度Ueditor编辑器