3 Replies Latest reply on Jun 5, 2006 1:12 PM by BKBK

    CF Code in CFFile created pages?

    silstorm
      I've hit a brick wall here, so would gladly appreciate some input!

      I'm trying to automate, as much as possible, the creation of 'sub sites' under a domain. At the moment, the directory is created using CFDirectory and the static files (images, css docs etc) are copied into it. However, I need to be able to set the datasource specific to the sub-site - which I had planned to do within the application.cfm file.

      I can get CFFile to create the application.cfm file, and put it in the right place, but the actual file itself is empty.

      All I need the application.cfm file to contain is <cfset datasource="blah"> (for the time being at least, but once I solve this issue I'll be able to address anything else I need to add later).

      Now, I have 2 problems here -

      Firstly, I need the CFFile to actually write the code into the application.cfm file - at the moment it just executes, and therefore produces a blank page. Secondly, the 'blah' part I need to actually be executed, because the actual datasource name I want to write into the page will be determined by the page that is running the cffile (and getting the variable from a form the page before).

      Hope that makes sense, but if anyone else can suggest a better method for doing this, I'm all ears!