Not really (unless you don't have an application.cfm file at all), but you can make it so the CODE in the application.cfm doesn't run when you visit a page. Just use an IF statement to check and see what page is being loaded. IF it's NOT the page you want to exclude, process the code in application.cfm, if it IS the page, skip the processing and do nothing.
Try this in your application.cfm:
<cfif GetFileFromPath(GetTemplatePath()) NEQ "Page.cfm">
...Whatever code you want to execute...
</cfif>
Hope This Helps!
Ecobb
"Alright Brain, you don't like me, and I don't like you. But lets just do this, and I can get back to killing you with beer." - Homer Simpson
You can also put the folder in a sub folder in the site and put a different Application.cfm file in the subfolder. When CF executes a page, it looks for that file in the current folder. When not found, it continues to move up directories until it hits the Root folder of the site where one 'should' be there.
Put your .CFM page in a subdirectory, an create an essentially blank Application.cfm in that same directory... something like:
Code:
<!--- blank application --->
(if memory serves, ColdFusion chokes if your Application.cfm is truly zero k/no characters... so just adding a ColdFusion comment is the work-around.
Then, when you hit the .CFM page in that subdirectory, your master/global Application.cfm won't run because it found one in that subdirectory.
While Ecobb's method works, it is a maintenance nightmare as you start adding more and more pages that shouldn't run the Application.cfm, or you're editing "Page.cfm" somewhere else on your site and you're banging your head against the wall because you can't figure out why it's behaving strangely.
You could wrap your application.cfm file within this:
<cfif NOT IsDefined("__application_cfm">
<cfset __application_cfm = 1>
.
.
.
.
</cfif>
This way, it will only run the code inside the <cfif> the first time the application.cfm is called. Plus, if you ever need to force it to be read again, just undefine the variable.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.