Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jul 6th, 2012  |  syntax: None  |  size: 0.61 KB  |  hits: 11  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. long/multiline content through cfset in Coldfusion
  2. <cfoutput>
  3. <CFSET page_title = "TITLE">
  4. <CFSET examplevariable = "ABC">
  5.  
  6. <CFSET content>
  7.  <!--something like this-->
  8.  <div>
  9.    bunch of content without any cf tags
  10.  </div>
  11. </CFSET>
  12.  
  13. <cfinclude template="include/layout.cfm">
  14.  
  15. </cfoutput>
  16.        
  17. <cfsavecontent variable="header">
  18.   <cfoutput>
  19.      I can be HTML, javascript anything text.
  20.      remember to escape pound sysmbols ie: ##FF0000 instead of #FF0000
  21.      I can even <cfinclude template="headerpage.cfm"> and will be stored in variable
  22.      called header
  23.   </cfoutput>
  24. </cfsavecontent>
  25.  
  26. <cfoutput>#header#</cfoutput>