由于织梦后台默认编辑器功能上的缺憾,使得在添加文章的时候,需要借用第三方编辑软件,对文章进行格式,然后再粘贴进织梦编辑器中。我们可以用百度的Ueditor编辑器来替换之,实现我们想要的结果。
下面是如何利用百度的(ueditor)编辑器替换dede自带的编辑器步骤:(不足之处请予以指正补充,谢谢!)
第一步:下载和织梦程序编码相对应编辑器的版本(UTF8或者GB2312);
百度搜索“百度ueditor编辑器”,然后点击进入官网,找到下载页面。找到我们想要的编辑器的版本,这点相信不要我多说了。下载下来,然后修改名称为“ueditor”,并进行打包上传到include目录下。
第二步:修改inc_func_funcAdmin.php文件;
打开include下的inc文件夹内的inc_func_funcAdmin.php找到184行,贴入以下代码。
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”/>
<textarea name=”‘.$fname.'” id=”‘.$fname.'”
style=”width:100%;”>’.$fvalue.'</textarea>
<script type=”text/javascript”>var ue = new
baidu.editor.ui.Editor();ue.render(“‘.$fname.'”);</script>’;
if($gtype==”print”)
{
echo $code;
}
else
{
return $code;
}
}
如下图所示: