FCKeditor configuration method

Source: Internet
Author: User
Asp.net Fckeditor Configuration
I. Download import Project
(1) download FCKeditor 2.6.5 and FCKeditor. Net 2.6.3 at http://ckeditor.com/download,
Decompress the two folders.
FCKeditor Editor, get the folder fckeditor, and copy the folder to the project of the Web application (or the child directory ).
Decompress the FCKeditor Control and have an assembly in its subdirectory bin/Release/2.0. Reference this Assembly in a Web application project.
(2) integration to Vis l St io Toolkit
Open an ASP. NET page, expand Toolbox, right-click the menu, and select "Choose Items... ", in the displayed" Choose Toolbox Items "session box". on the "NET Framework Components" tab, select "Browse", find and select the FCKeditor assembly, open it, return to the "Choose Toolbox Items" window, and click "OK" to import the control.
In this case, a control named FCKeditor is displayed under the General classification of Toolbox, which can be used just like the Vis l St io built-in control.
(3) Add the FCKeditor file to ASP. NET.
The FCKeditor file group contains files for various application technologies supported by the FCKeditor. Therefore, many files are not required for ASP. NET applications.
In the root directory, only the folder editor is retained. The files fckconfig. js, fckeditor. js, fckpackager. xml, fckstyles. xml, and fcktemplates. xml are retained.
Only the folder aspx is retained under the subdirectory editor, filemanager, and connectors.
II. Web. config Configuration:
The FCKeditor Control is used on the page. You need to know the path of the FCKeditor file group. There are two configuration methods.
Add
<Add key = "FCKeditor: BasePath" val = "~ /PathOfFCKeditor/"/>
After this configuration method is used, you do not need to configure its BasePath attribute for the FCKeditor Control used on any page of the project.
Directly configure the FCKeditor Control
In the code on the page, set the attribute BasePath of FCKeditor to the path of the FCKeditor file group, or set its BasePath value in the Page_Init event processor.
Configure the FCKeditor File Upload path
In the appSettings configuration section of web. config, add
<Add key = "FCKeditor: UserFilesPath" val = "~ /YourUploadFilePath "/>

This completes the integration of FCKeditor to ASP. NET pages.
3. Configure FCKeditor
Find FCKeditor \ fckconfig. js in Solution Explorer
1. Configure the control language
FCKeditor automatically detects the language encoding used by the browser. The default language is English. Modify the configuration line "fckconfig. defaultlang Ge = 'en';" to 'zh-cn'. use Chinese as the default language.
2. Configure the Control Application Technology
FCKeditor is used for PHP by default. Modify the configuration line "VaR _ filebrowserlang Ge = 'php';" and "VaR _ quickuploadlang Ge = 'php';" to 'ASP', using ASP. NET technology.
3. Configure the tab key
The default Tab key is unavailable in FCKeditor. You can modify the configuration line "fckconfig. tabspaces = 0;" to 1, and enable the tab key.
4. Customize the FCKeditor Toolbar
Fcleditor has three default values: Default, office2003, and silver. Next let's talk about how to change
Edit fckconfig. js in the fck directory and find this line.
Fckconfig. skinpath = fckconfig. basepath + 'Skins/default /';
Modifiable
FCKConfig. SkinPath = FCKConfig. BasePath + 'Skins/silver /';
FCKConfig. SkinPath = FCKConfig. BasePath + 'Skins/office2003 /';
FCKConfig provides two toolbar configurations. In the configuration line "FCKConfig. ToolbarSets [" Default "] = [...];", the configuration of all available buttons is defined (as the Default configuration of the toolbar ). In the configuration line "FCKConfig. ToolbarSets [" Basic "] = [...];", the toolbar configuration of a simplified button is defined. In actual use, there are too many configuration buttons by default, and there are too few simplified configuration buttons. Therefore, you need to customize the toolbar.
Configuration value [...] in the format of [[v, v2 ,.., vN], '/', [...],...] (vN indicates the name of the button to be displayed, '/' indicates the next row of the subsequent button group. If you do not need a button for the entire group, delete the group (in the form of [,...]). If you only do not need a button in the group, delete the button.
5. Customize available text Fonts
FCKeditor is made by foreigners. The default font is also a Spanish font. Modify the configuration line "FCKConfig. FontNames = '...';" and add the names of Chinese characters to be used, such as, and _ GB2312.
By default, FCKConfig uses the HTML font keyword to indicate the optional font size, which leads to inconsistent display effects in different browsers. Therefore, we recommend that you modify the configuration line "FCKConfig. FontSizes = '...';" to remove the font keyword value and add the pixel value or pound value. (Of course, if the global style sheet is defined on the webpage, you do not need to modify this setting, but you should teach the end user how to set the font to achieve the best display effect .)
6. Enable File Upload
FCKeditor provides powerful and easy-to-use File Upload functions, but the file upload function is not available in the default configuration, which is based on security considerations. However, I think that access security control should be implemented by programs rather than controls.
In the config. ascx file, modify the return value of checkauthentication () to tr. If you want to upload a file with multiple extensions, set the value of forcesingleextension in setconfig () to false. FCKeditor can upload files, images, Flash files, and multimedia files by default () modify allowedtypes to increase or decrease the allowed types (this type can be defined in typeconfig ["typename"]. For example, in the allowedextensions attribute, you can customize the file extension allowed by this type.
Deniedextensions ).
In the fckconfig. js file,
Modify the configuration line "fckconfig. linkbrowserurl = fckconfig. basepath + 'filemanager/Browser/default/browser.html? Connector = '+ encodeuricomponent (fckconfig. basepath + 'filemanager/connectors/' + _ filebrowserlang Ge + '/connector.' + _ filebrowserextension );"
Is fckconfig. linkbrowserurl = fckconfig. basepath + 'filemanager/Browser/default/browser.html? Type = file & connector = '+ encodeuricomponent (fckconfig. basepath + 'filemanager/connectors/' + _ filebrowserlang Ge + '/connector.' + _ filebrowserextension );"
Modify the configuration line "fckconfig. linkuploadurl = fckconfig. basepath + 'filemanager/connectors/'+ _ quickuploadlang Ge +'/upload. '+ _ quickuploadextension ;"
For fckconfig. linkuploadurl = fckconfig. basepath + 'filemanager/connectors/'+ _ quickuploadlang Ge +'/upload. '+ _ quickuploadextension + '? Type = FILE'; (in this configuration file, it seems that type = file is used as the default parameter, but if this parameter is not actually added, an error will occur .)

7. Other configurations
For the configuration attributes in these two configuration files, you can easily know the meaning of the two configuration files from the name, which can be basically customized. Note that,
V. Other problems:
Solution for XML reqst error: internal server error (500) error when using the file upload function during development.
Because ASP. NET2.0 has the Theme feature added, if you use styleSheetTheme or theme for Web. config in your project, you need to modify it more.
To the directory where FCKeditor is located, open \ editor \ filemanager \ upload \ aspx \ upload. aspx and \ editor \ filemanager \ browser \ default \ connectors \ aspx \ connector. aspx files: Add Theme = "" Or StyleSheetTheme = "" to the page tab to modify Theme when you are using the project. The modification is as follows:
<% @ Page lang ge = "c #" Inherits = "FredCK. FCKeditorV2.Uploader" AutoEventWireup = "false" Theme = "" %>
Or
<% @ Page lang ge = "c #" Inherits = "FredCK. FCKeditorV2.Uploader" AutoEventWireup = "false" StylesheetTheme = "" %>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.