首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
您现在的位置: 程式碼之家 >> 編程語言 >  >> .NET 網頁程式設計 >> ASP.NET 基礎 >> 關於ASP.NET

MOSS 專案整合 FCKeditor 網頁編輯器:從下載到部署完整攻略

     編輯:關於ASP.NET

在 MOSS (Microsoft Office SharePoint Server) 專案開發資訊發布系統時,需一款支援圖片上傳、易於整合 WebPart 的編輯器。經評估 WebHTMLEditor (收費)、eWebEditor/FreeTextBox (上傳功能受限)、FCKeditor (開源、功能全),最終選用 FCKeditor 2.6.3。

整合步驟

  1. 下載並解壓:取得 FredCK.FCKeditorV2.dll (來自 FCKeditor.Net) 與 fckeditor 目錄 (來自主包)。
  2. 建立 WebPart 專案,引用 DLL,核心代碼:
private FredCK.FCKeditorV2.FCKeditor fckContent = new FredCK.FCKeditorV2.FCKeditor();
protected override void CreateChildControls()
{
    fckContent.BasePath = "/_layouts/fckeditor/";
    this.Controls.Add(this.fckContent);
}
protected override void Render(HtmlTextWriter writer)
{
    fckContent.RenderControl(writer);
}
  1. 部署靜態資源:將 fckeditor 整個資料夾複製到 MOSS 站點 _layouts 目錄 (C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\template\layouts\)。
  2. 建立上傳目錄並授權:在 fckeditor 下建立 userfiles 資料夾,授予上傳用戶寫入權限。
  3. 修改設定檔:
    • fckconfig.js:設定語言 FCKConfig.DefaultLanguage = 'zh-cn';上傳協定 _FileBrowserLanguage = 'aspx'、_QuickUploadLanguage = 'aspx'。
    • fckeditor\editor\filemanager\connectors\aspx\config.ascx:CheckAuthentication() 回傳 true;UserFilesPath = "/_layouts/fckeditor/userfiles/"。
  4. 部署 WebPart 至 MOSS 測試,若失效請檢查 BasePath、UserFilesPath 是否為正確相對路徑。

避坑提醒

  • 路徑必須為相對路徑 (以 / 開頭)。
  • 上傳目錄權限是常見失敗點,需確保 IIS 執行身分 (Network Service / AppPool Identity) 有寫入權限。
  • FCKeditor 已停止維護,新專案建議改用 CKEditor 4/5。
  1. 上一篇文章:
  2. 下一篇文章:
Copyright © 程式碼之家 All Rights Reserved