I have a website administrator application that my company built that when you add a page to the subnavigation it creates the .cfm page and adds the file to a database. In each file I get the content of that page from the database based on that pages category id and id. so in the function that creates the page I copy over a template page that I have, and at the top of the page it sets paramaters for the catid and id
CODE
<cfparam name="catid" default="x">
<cfparam name="id" default="x">
That is exactly how the template looks with the reast of the code for the page following. What I need to do is open the file and replace the x with the actual catid and id that gets passed through arguments.
Function to create the page:
CODE
//Set folder as catID #Arguments.catid#
folder = "catID" & ARGUMENTS.catid;
//Get the actual folder based on the original folder variable
if (folder EQ "catID1"){
folder = catID1;
}
else if (folder EQ "catID2"){
folder = catID2;
}
else if (folder EQ "catID3"){
folder = catID3;
}
//Set the absolute path to the folder
fullfolder = expandpath(folder);
//Set the folder and file
fill = newstring & ".cfm";
folderfile = fullfolder & file;
folderfiletemp = fullfolder & "template.cfm";
//Copy the template file
fileCopy(folderfiletemp,folderfile);
//Open the file to edit the catid and id
fileOpen(folderfile,"append");
</cfscript>
That is just part of it. I don't think anyone will need anything else.