It is very easy to use FCKeditor in your ColdFusion web pages. Just follow these steps.
Integration step by step
Step 1
Create a cfm page which will include the following <cfmodule> code:
<cfmodule template="/fckeditor/fckeditor.cfm" basePath="/fckeditor/" instanceName="myEditor" value='<p>This is some <strong>sample text</strong>. You are using <a href="http://www.fckeditor.net/">FCKeditor</a>.</p>' width="100%" height="200" >
In the above example, BasePath is set to the URL path to the FCKeditor installation folder.
Step 2
The editor is now ready to be used. Just open the page in your browser to see it at work.
NOTE: The steps written above are essential to integrate the FCKeditor in your page. However there are some steps you should take to configure the editor more properly:
Step 3
FCKeditor comes with a default File Browser that makes it easy to user to upload files and images to the server, as well as browse the available files for reuse. It is also available a "Quick Upload" feature to quickly upload files and create links for them. This default system is integrated with all server side languages supported by FCKeditor. You just need to make a simple configuration to indicate which one you are using. To do that for ASP.NET, just open the fckconfig.js file in the directory where you have copied the FCKeditor core package. Look for the _FileBrowserLanguage and _QuickUploadLanguage entries and set their values to cfm :
var _FileBrowserLanguage = 'cfm' ; var _QuickUploadLanguage = 'cfm' ;
You must prepare your site to accept the uploaded files and their relative directory. structure. By default FCKeditor will look for the UserFiles directory in the root of the web site, and place all files there. So, just create that directory.
Remember to check the editor\filemanager\connectors\cfm\config.cfm file and see if the ColdFusion connector is enabled:
Config.Enabled = true ;
Step 4
If you want to change the default user files directory place this code in your page source code:
<cfset request.FCKeditor = StructNew()> <cfset request.FCKeditor.userFilesPath = "/fceditor/NewUserFilesDirectory/"> (or whatever other directory you want to use)
<cfset request.FCKeditor = StructNew()>
Sample Code
<cfsetting enablecfoutputonly="true"> <cfoutput> <html> <head> <title>FCKeditor - Sample</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <meta name="robots" content="noindex, nofollow"> </head> <body> <h1>FCKeditor in Coldfusion</h1> </cfoutput> <cfmodule template="/fckeditor/fckeditor.cfm" basePath="/fckeditor/" instanceName="myEditor" value='<p>This is some <strong>sample text</strong>. You are using <a href="http://www.fckeditor.net/">FCKeditor</a>.</p>' width="100%" height="200" > </form> </body> </html> <cfsetting enablecfoutputonly="false">