aspcms官方的編輯器一直不好用,從WORD中復制的文本到里面格式也會變形。
所以,我就把官方自帶的編輯器換成了 kindeditor 。
廢話少說,開始替換。
下載附件使用的同學,upload 目錄下需先新建 image 文件夾,上傳的圖片都在這個文件夾下。
kindeditor修改合并步驟:
1.打開后臺文件夾,官方默認是 admin_aspcms,官方默認的編輯器是 editor,不用管,調用編輯器的位置在 \_content\ ,,里面文件夾分別有 文章,單篇,等,_About 是單篇文章 的路徑,_Content是文章 產品等 路徑。
2.下載 kindeditor ,官方下載地址 復制kindeditor編輯器到后臺路徑,如 /admin_aspcms/ ,
3.配置kindeditor,ASPCMS是gb2312編碼的,KINDEDITOR是utf-8編碼的,需要將 kindeditor中文件的編碼轉換為 gb2312,一般我只轉換/kindeditor/lang/zh_CN.js,其他的暫沒有發現影響。
4.我這里只對一個文件進行演示,其他略同,打開 /admin_aspcms/_content/_About/AspCms_AboutEdit.asp 在<head></head>中添加
-
<script charset="gb2312" src="../../kindeditor/kindeditor-min.js"></script>
-
<script charset="gb2312" src="../../kindeditor/lang/zh_CN.js"></script>
-
<script type="text/javascript">
-
function LoadEditor(a) {
-
var b;
-
return b = KindEditor.create('textarea[name="' + a + '"]', {
-
uploadJson: "../../kindeditor/asp/upload_json.asp",
-
fileManagerJson: "../../kindeditor/asp/file_manager_json.asp",
-
allowFileManager: !0,
-
filterMode: !1
-
});
-
}
-
KindEditor.ready(function() {
-
LoadEditor("content");
-
});
-
</script>
搜索插入分頁<BR> 將下面
-
-
<%Dim oFCKeditor:Set oFCKeditor = New FCKeditor:oFCKeditor.BasePath="../../editor/":oFCKeditor.ToolbarSet="AdminMode":oFCKeditor.Width="615":oFCKeditor.Height="300":oFCKeditor.Value=decodeHtml(Content):oFCKeditor.Create "Content"
-
'Default,AdminMode,Simple,UserMode,Basic
替換為
-
<textarea name="content" style="width:700px;height:300px;visibility:hidden;"><%=content%></textarea>
<%=content%>是文章的內容。 其他位置的編輯器修改和此處略同!
5.重新刷新頁面,新的編輯器就出現了,文章內容的編輯器替換和它一模一樣,這里就不再重復說明。