This content has been marked as final. Show 5 replies
Are you sure you don't mean getCURRENTtemplatePath()?
Yes, I'm trying to get the filename of the original (base) template. I am using the script in a custom tag. If I use GetCurrentTemplatePath then it returns the filename of the custom tag (which is not what I expected -- I would expect it to be similar to GetBaseTemplatePath). I have tried GetBaseTemplatePath, CGI.CF_TEMPLATE_PATH, and CGI.SCRIPT_NAME. They all return the path of the file I am redirecting TO, not the file I am redirecting FROM.
You could always try caller.cgi.something. Maybe it'll work, maybe it'll crash.
Right, I see.
I presume the URL to the request you're looking at is along the lines of
http://domain/path/to/index.cfm? So index.cfm is your base template.
I also presume index.cfm includes some file, eg: dsp_home.cfm, and within
that you are calling <cf_mytag>, and within that you are doing this
<cflocation>? If that's the case, you don't want the base template.
The only way I have found of accessing the tagcontext stack is to create an
exception object. As you want the template that called the current one,
it'll be the second one in the stack:
This information will be locked up *somewhere* in the getPageContext()
object, but I'm buggered if I can find it.
> You could always try caller.cgi.something. Maybe it'll work, maybe it'll crash.
CGI variables are global to the request, so there's no need for the
They're not specific to a CF template, as they're set by the web server,
which doesn't know anything about CF, which templates are called what,
which order they are called in or anything like that.