Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Coldfusion cfsavecontent

Posted on 2013-06-17
2
Medium Priority
?
1,180 Views
Last Modified: 2013-06-17
I am using a cfsavecontent tag to write the results from a database to a index.cfm page. The problem I am experiencing is that the cfsavecontent hard-codes the cfincludes as well. This is a problem because some of the cfincludes  will change over time.
I am not sure if there is a coldfusion or javascript way of simply ensuring that
<cfinclude template="/advert/rt_300x250.cfm">
remains within the code not the contents of the rt_300x250.cfm.

Here is a short example

<cfsavecontent variable="cachedOutput">

<cfinclude template="/advert/rt_300x250.cfm">
</cfsavecontent>


<cffile action="write"
file="#hardNewPathUrlDestintation#\index.cfm"
output="#cachedOutput#">

Open in new window

0
Comment
Question by:swaggrK
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 52

Accepted Solution

by:
_agx_ earned 1000 total points
ID: 39254224
You need to escape the CF tag, so it doesn't execute.  I don't think htmleditformat will do it.. Maybe something like?

<cfsavecontent variable="cachedOutput">
<cfoutput>#chr(60)#cfinclude template="/advert/rt_300x250.cfm"></cfoutput>
</cfsavecontent>

There may be better options, but I can't think of any off the top of my head.
0
 

Author Comment

by:swaggrK
ID: 39254265
That worked. Great! Thanks!
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Why is this different from all of the other step by step guides?  Because I make a living as a DBA and not as a writer and I lived through this experience. Defining the name: When I talk to people they say different names on this subject stuff l…
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.
Suggested Courses

610 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question