• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Interprete generated content possible?

New Here ,
May 23, 2006 May 23, 2006

Copy link to clipboard

Copied

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

TOPICS
Advanced techniques

Views

262

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 23, 2006 May 23, 2006

Copy link to clipboard

Copied

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

<cfoutput>#myContent#</cfoutput>

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advisor ,
May 23, 2006 May 23, 2006

Copy link to clipboard

Copied

LATEST
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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation