Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

long/multiline content through cfset in Coldfusion

Tags:

coldfusion

is there a way to set a variable with cfset that acts more like a cdata tag

or is there another way of having a page with some basic variables set and a couple of longer variables set for the main content;

ie.

<cfoutput>
<CFSET page_title = "TITLE">
<CFSET examplevariable = "ABC">

<CFSET content>
 <!--something like this-->
 <div>
   bunch of content without any cf tags
 </div>
</CFSET>

<cfinclude template="include/layout.cfm">

</cfoutput>
like image 594
Daniel Avatar asked Jan 06 '11 21:01

Daniel


1 Answers

<cfsavecontent variable="header">
  <cfoutput>
     I can be HTML, javascript anything text.
     remember to escape pound sysmbols ie: ##FF0000 instead of #FF0000
     I can even <cfinclude template="headerpage.cfm"> and will be stored in variable 
     called header
  </cfoutput>
</cfsavecontent>

<cfoutput>#header#</cfoutput>
like image 127
cfEngineers Avatar answered Oct 16 '22 08:10

cfEngineers