Skip to main content
Known Participant
May 23, 2006
Question

Interprete generated content possible?

  • May 23, 2006
  • 2 replies
  • 362 views
Hello,

What i want to do is very simple but i don't know how..

I want to generate some content which includes some coldfusion tags,
After i have my content as a variable i want to process it

so my result is something like this: ( to keep it simple) :

<cfset myContent = "<cfset x = "test"><cfoutput>#test#</cfoutput>">

<cfset result = ParseContent(mycontent)>

the ParseContent function should interprete the myContent variable as coldfusion
if you know what i mean .. so it gives me 'test' as a result

the clue is to parse text as coldfusion
any ideas?

Regards,

N0cTje

This topic has been closed for replies.

2 replies

May 23, 2006
Note that you must be much more careful with quotes and octothorpes than the first post.

Also, since you are using tags you cannot use the evaluate function.

The only way that you could get ParseContent() to work is to:
(1) Create a temporary cfm file on the fly.
(2) Write the string out to the temp file.
(3) Cfinclude the temp file.

This approach could get hairy fast and would be defeated by caching, deploying, etc.
BKBK
Community Expert
Community Expert
May 23, 2006
<cfsavecontent variable="myContent">
<cfset x = "test">
<cfoutput>#x#</cfoutput>
</cfsavecontent>

<cfoutput>#myContent#</cfoutput>