This topic of dynamically writing a CF template is related to something
I've tried to do without success: execute CF code that is stored in a
database. Has anybody attempted this successfully, or do you have any
idea how it might be done? Here's an example of what I'm talking about:
<CFQUERY NAME="GetCode" DATASOURCE="Test3">
SELECT CodeID, Code from CodeTable
WHERE CODEID = 3
</CFQUERY>
<!--- Note: the above query using CodeID = 3 returns this:
<CFSET TEST = 'Y'><CFOUTPUT>#TEST#</CFOUTPUT>
--->
<HTML>
<BODY>
<P>
<CFOUTPUT>
HTMLCODEFORMAT(GetCode.Code) is #HTMLCODEFORMAT(GetCode.Code)#
<P>
GetCode.Code is #GetCode.Code#
<P>
<!--- Doesn't work:
Evaluate(DE(GetCode.Code)) IS #Evaluate(DE(GetCode.Code))#
--->
<P>
</CFOUTPUT>
<P>
<CFIF IsDefined("Variables.Test")>
Test exists with a value of #Variables.Test#
<CFELSE>
Test does not apparently exist
</CFIF>
</BODY>
</HTML>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists