using <cfif> inside <cfsaveceonten>

Discussion in 'Programming' started by slornitzo, Jun 24, 2010.

  1. #1
    I Have a <cfif><cfelse> block inside a <cfsavecontent> and then I use <cffile write to write that content. I want the <cfif><cfelse> tags to be copied not parsed. Right now it only writes whichever part of the <cfif> tag is true. I want the whole block to be saved as content and written to a new file.

    Can't seem to find an answer.
     
    slornitzo, Jun 24, 2010 IP
  2. cfStarlight

    cfStarlight Peon

    Messages:
    398
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #2
    You mean you want the literal text "<cfif>" written to the file, you'll need to do something so they're not evaluated. Like escaping the cfml tags

    
    ie &lt;cfif &gt; instead of <cfif>
    
    Code (markup):
     
    cfStarlight, Jun 24, 2010 IP
  3. cfStarlight

    cfStarlight Peon

    Messages:
    398
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Also, the same applies to most any CF tag. They will automatically be evaluated, unless you escape the tags so they're treated as strings instead of executed.
     
    cfStarlight, Jun 24, 2010 IP