>> Is there a variable (maybe a cgi variable) that stores
>> the root web
>> path for the current template.  For example..

> Unfortunately, ColdFusion doesn't seem to have anything
> similar to the ASP
> APPL_MD_PATH variable. If all of you're files are in the
> same directory,
> then you can use a combination of CGI variables (<cfdump
> var="#cgi#">) to
> build the URL. You can treat the CGI.SCRIPT_NAME as a list
> delimited by "/".
> If your files are in various sub-directories, then it's
> probably just as
> easy to hard code a global variable that stores the
> relative portion of the
> path.

> Ben Rogers
> http://www.c4.net
> v.508.240.0051
> f.508.240.0057

Well assuming you only need the current directory of the base
template, the answer is easy -- using getdirectoryfrompat() around
your cgi variables... however... if you need a more complex or more
dynamic answer, there isn't really a simple one with CF. The onTap
framework includes some url-management features in its core
components, part of which is that the framework automatically
determines the physical path to the framework root directory and
matches that with a comparable url variable. This way it's possible to
easily compare a file on the drive with a url,i.e.

<cfif fileexists(request.tapi.getPath("/my/cf/page.cfm","T"))>
<a href="#request.tapi.getURL("/my/cf/page.cfm","T")#">
this is a link to a page I know exists</a></cfif>

The value "T" is an "alias" for the onTap framework root directory --
there are several other aliases created by default, and you can create
your own aliases as needed, such as "docs" which is used by the
framework documentation to reference itself. As a rule I never create
an alias without using another alias as the beginning of its value,
thus since the alias "T" is always an automatically generated pointer
to the framework's root directory and all other paths are ultimately
derived from it, I can move the application to any location without
worrying about any of my urls or file-management features failing.

s. isaac dealey   954.927.5117

new epoch : isn't it time for a change?

add features without fixtures with
the onTap open source framework
http://www.sys-con.com/story/?storyid=44477&DE=1
http://www.sys-con.com/story/?storyid=45569&DE=1
http://www.fusiontap.com




~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Special thanks to the CF Community Suite Gold Sponsor - CFHosting.net
http://www.cfhosting.net

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:186137
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to