2 Replies Latest reply on May 10, 2007 8:04 AM by Newsgroup_User

    Does CF parser include statement within if-statement

    epo
      Hi,

      I usually create small sites which have only couple of pages and I'm used to write all the code into single cfm-file with cfif url.area eq "foo" etc statements.

      I was wondering that if I was to make a highly trafficed site, would it be better just to write each part to it's own cfm-file or does coldfusion ignore includes when they are inside cfif -> /cfif if the comparision doesnt fit?

      I just don't want to parser 100k lines of code each time but still would like to keep them in "single" file.

      Any other ways to do this would also be appreciated :)

      - epo
        • 1. Re: Does CF parser include statement within if-statement
          jdeline Level 1
          The following is perfectly acceptable:

          <CFIF foo IS TRUE>
          <CFINCLUDE TEMPLATE="one.cfm">
          <CFELSE>
          <CFINCLUDE TEMPLATE="two.cfm">
          </CFIF>
          • 2. Re: Does CF parser include statement within if-else
            Level 7
            Another option would be something like:

            <cfinclude template = "#area#.cfm" />

            --
            Bryan Ashcraft (remove brain to reply)
            Web Application Developer
            Wright Medical Technology, Inc.
            ------------------------------------------------------------------
            Macromedia Certified Dreamweaver Developer
            Adobe Community Expert (DW) :: http://www.adobe.com/communities/experts/



            "epo" <webforumsuser@macromedia.com> wrote in message
            news:f1jfs9$nlc$1@forums.macromedia.com...
            > Hi,
            >
            > I usually create small sites which have only couple of pages and I'm used
            > to
            > write all the code into single cfm-file with cfif url.area eq "foo" etc
            > statements.
            >
            > I was wondering that if I was to make a highly trafficed site, would it be
            > better just to write each part to it's own cfm-file or does coldfusion
            > ignore
            > includes when they are inside cfif -> /cfif if the comparision doesnt fit?
            >
            > I just don't want to parser 100k lines of code each time but still would
            > like
            > to keep them in "single" file.
            >
            > Any other ways to do this would also be appreciated :)
            >
            > - epo
            >