Configure ckeditor3.0 and ckfinder

Source: Internet
Author: User

First, download these two things:

Http://ckeditor.com/

Http://ckfinder.com/

 

1. Start Configuration

 

1.1CkeditorDecompress the package and put it under the website directory.

 

1.2 put the downloaded ckfinder under the root directory of ckeditor.

 

1.2.1 configure firstCkfinder.

 

Open the ckfinder directory and find config. ascx.

Modify the public override bool CheckAuthentication () method. This is used to verify whether the user is logged on. The following is return false. You can modify it according to your own business.

For example, (Session ["IsAuthorized"]! = Null & (bool) Session ["IsAuthorized"] = true );

Locate ckfinder. js (this is used to modify the location where the file is stored after being uploaded)

The default value is CKFinder. DEFAULT_BASEPATH = '/ckfinder /';

 

1.2.2 configure ckeditor

 

Open the config. js file under the ckeditor directory.

Below is my configuration

Code
CKEDITOR. editorConfig = function (config)
{
// Define changes to default configuration here. For example:
Config. AutoDetectLanguage = false;
Config. language = 'zh-cn'; // configuration language
Config. uiColor = '# f00'; // background color
Config. width = 700; // width
Config. height = 200; // height
Config. skin = 'v2 ';
Config. theme = 'default ';

Config. tabSpaces = 4; // Add spaces to the tab key
Config. resize_enabled = true; // whether the size of the edit box can be adjusted
Config. toolbarCanCollapse = true; // whether scaling is allowed
Config. toolbarStartupExpanded = false; // whether to disable it by default during loading

// Configure ckfinder
Config. filebrowserBrowseUrl = '/xx/ckeditor/ckfinder/ckfinder.html ';
Config. filebrowserImageBrowseUrl = '/xx/ckeditor/ckfinder/ckfinder.html? Type = Images ';
Config. filebrowserFlashBrowseUrl = '/xx/ckeditor/ckfinder/ckfinder.html? Type = Flash ';
Config. filebrowserUploadUrl = '/xx/ckeditor/ckfinder/core/connector/aspx/connector. aspx? Command = QuickUpload & type = Files ';
Config. filebrowserImageUploadUrl = '/xx/ckeditor/ckfinder/core/connector/aspx/connector. aspx? Command = QuickUpload & type = Images ';
Config. filebrowserFlashUploadUrl = '/xx/ckeditor/ckfinder/core/connector/aspx/connector. aspx? Command = QuickUpload & type = Flash ';
Config. filebrowser1_wwidth = '20140901 ';
Config. filebrowserWindowHeight = '2013 ';

// Toolbar
Config. toolbar = [
['Source', '-', 'preview', '-', 'templates'],
['Cut ', 'copy', 'paste', 'pastetext ', 'pastefromword','-', 'print', 'spellchecker ', 'scayt'],
['Undo ', 'redo', '-', 'Find ', 'replace', '-', 'selectall', 'removeformat'],
['Form', 'checkbox', 'Radio ', 'textfield', 'textta', 'select', 'click', 'imagebutton ', 'hiddenfield'],
['Bold ', 'italic', 'underline', 'strike', '-', 'subscript', 'superscript'],
['Numberlist', 'bulletedlist', '-', 'outdent ', 'indent', 'blockquote'],
['Justifyleft', 'justifycenter', 'justifyright', 'justifyblock'], ['link', 'unlink', 'anchor '],
['Image', 'flash', 'table', 'horizontalrule', 'smiley ', 'specialchar', 'pagebreak'],
['Styles ', 'format', 'font', 'fontsize'],
['Textcolor', 'bgcolor'],
['Delimiter', 'showbucket', '-'];

};

 

To reduce the size of the editor, you can delete unnecessary files, such as deleting the _ samples, _ source, and _ tests folders to enter the lang file directory and retain en. js, zh. js, zh-cn.js three files, other language files if you can not use, you can delete.

 

2. Call

 

Code
<Script type = "text/javascript" src = "http://www.cnblogs.com/xx/ckeditor/ckeditor.js"> </script>
Details: <textarea class = "ckeditor" id = "editor1" name = "editor1" runat = "server">
</Textarea>
<Script type = "text/javascript">
CKEDITOR. replace ('editor1 ');
</Script>

 

 

It's almost done. Test it.

Additional:/Files/sera/ckeditor文 .rar. This configuration document is translated by Google.

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.