Fckeditor 配置

赫连冠玉
2023-12-01
1. 在你的网站中添加web.config文件,并配置以下节内容:
  <appSettings>     <add key="HostName" value=" http://localhost/"/>     <add key="UploadDir" value="Upload"/>   </appSettings>
其中HostName是你的主机名,也就是域名,图片上传时,会从这里读取信息,组合成资源地址,如果填错,将无法在编辑器中看到实时的图片。 UploadDir存放图片上传到的目录名称,该目录位于你的网站目录下,一定要确保这个目录对.NET用户有写权限。
提示:可以先设为everyone的权限,再逐步调细。
2. 在加载编辑器的页面的page_load事件处理函数中,设定editor的所在位置
FCKeditorMsp.BasePath = "FckEditorv2/";
这里是指,编辑器在网站下FckEditorv2目录中。
3. 设定工具栏
打开editor目录中的fckconfig.js文件,修改:
FCKConfig.ToolbarSets["Default"] = [  ['Source','DocProps','-','Save','NewPage','Preview','-','Templates'],  ['Cut','Copy','Paste','PasteText','PasteWord','-','Print','SpellCheck'],  ['Undo','Redo','-','Find','Replace','-','SelectAll','RemoveFormat'],  //['Form','Checkbox','Radio','TextField','Textarea','Select','Button','ImageButton','HiddenField'],  ['InsertCode','InsertImage'],  '/',  ['Bold','Italic','Underline','StrikeThrough','-','Subscript','Superscript'],  ['OrderedList','UnorderedList','-','Outdent','Indent'],  ['JustifyLeft','JustifyCenter','JustifyRight','JustifyFull'],  ['Link','Unlink','Anchor'],  [/*'Image','Flash',*/'Table','Rule',/*'Smiley',*/'SpecialChar','PageBreak'],  '/',  ['Style','FontFormat','FontName','FontSize'],  ['TextColor','BGColor'],  ['FitWindow','-','About']   ] ;
 类似资料: