When I insert Coldfusion tags via the SOURCE button in FCKEditor, the code is being saved with errors (i.e., single quotes are replaced with "’", <cfif> statements are disassembled).
For example,
<cfif query.recordcount GT 0>
becomes this:
<cfif gt="" query.recordcount="">
I am able to place javascript in FCKEditor just fine. The problems only occur with Coldfusion tags.
I found another post describing this problem (viewtopic.php?f=6&t=2065&p=5182&hilit=+coldfusion+tags#p5182)- and it suggested adding these lines to the config file:
FCKConfig.ProtectedSource.Add( /<cf[\s\S]*?>/gi ) ; // ColdFusion cf tags - OPEN. FCKConfig.ProtectedSource.Add( /<\/cf[\s\S]*?>/gi ) ; // ColdFusion cf tags - CLOSE.
I tried this but that didn't fix the problem.
I also tried adding the Coldfusion tags to the list of Protected Tags in the config file, but that didn't work either.
FCKConfig.ProtectedTags = 'cfquery|cfif|cfoutput' ;
I hope I'm just overlooking something obvious. I can't figure this one out.
Re: Using ColdFusion Tags in FCKEditor
Re: Using ColdFusion Tags in FCKEditor
Thanks,
chris
Re: Using ColdFusion Tags in FCKEditor
This preserves the coldfusion tags. I still can't keep the apostrophes and greater than/less than signs from switching to "’ < >".
Re: Using ColdFusion Tags in FCKEditor
thanks,
chris
Re: Using ColdFusion Tags in FCKEditor
Re: Using ColdFusion Tags in FCKEditor
Re: Using ColdFusion Tags in FCKEditor
Re: Using ColdFusion Tags in FCKEditor
I'd prefer to clean it up before it is saved to SQL, but this was the best I could come up with.
Re: Using ColdFusion Tags in FCKEditor
You use a function to fix the code after it's retrieved with the following function:
<cffunction name="CleanUpCode" access="public" returntype="string" output=true>
<cfargument name="string" type="string" required="true"/>
<cfset string = #Replace(string, "’", "'", "all")#>
<cfset string = #Replace(string, "<", "<", "all")#>
<cfset string = #Replace(string, ">", ">", "all")#>
<cfreturn string>
</cffunction>
Can you give me the exact syntax that you used?
I can't seem to get it to work.