# FCKeditor - Sample

<cfoutput>

# FCKeditor - ColdFusion Component (CFC) - Sample 2

This sample shows the editor in all its available languages.

</cfoutput> <cfif listFirst( server.coldFusion.productVersion ) LT 6> <cfoutput>
This sample works only with a ColdFusion MX server and higher, because it uses some advantages of this version.</cfoutput> <cfabort> </cfif> <cfoutput>

Select a language: |

</cfoutput> <cfscript> // Calculate basepath for FCKeditor. It's in the folder right above _samples basePath = Left( cgi.script_name, FindNoCase( '_samples', cgi.script_name ) - 1 ) ; fckEditor = createObject( "component", "#basePath#fckeditor" ) ; fckEditor.instanceName = "myEditor" ; fckEditor.value = '

This is some sample text. You are using FCKeditor.

' ; fckEditor.basePath = basePath ; if ( isDefined( "URL.Lang" ) ) { fckEditor.config["AutoDetectLanguage"] = false ; fckEditor.config["DefaultLanguage"] = HTMLEditFormat( URL.Lang ) ; } else { fckEeditor.config["AutoDetectLanguage"] = true ; fckEeditor.config["DefaultLanguage"] = 'en' ; } fckEditor.create() ; // create the editor. </cfscript> <cfoutput>
</cfoutput>