something like this?
GetDirectoryFromPath(GetCurrentTemplatePath())
but it will return the path of the current template only you can use it in
something like the app_globals.cfm to set the path dynamically
i code from home...it goes to a demo server...then it hits a production
server so i just use app_globals.cfm method
**THIS WOULD HAVE TO BE IN THE WEBROOT TO RETURN THE RIGHT PATH**
<!---app_globals.cfm --->
<cfif not isdefined('request.maindsn')>
<cfscript>
request.webroot ="http://#cgi.server_name#/sitename";
request.imageroot ="http://#cgi.server_name#/sitename/images";
request.maindsn="datasourcename";
request.timespan=createtimespan(0,0,15,0);
request.webpath="GetDirectoryFromPath(GetCurrentTemplatePath()) ";
request.imagepath="GetDirectoryFromPath(GetCurrentTemplatePath())
\images";
request.cfroot="/cfmappingname";
</cfscript>
</cfif>
and any other frequently reused vars that might change from demo to
production like error email, and such
then I <cfinclude> this in Application.cfm
now all my
Image tags look like <img src="#request.imageroot#/image.gif">
Links look like <a href="#request.webroot#/dir/template.cfm">
CFQueries <cfquery name="name" datasource="#request.maindsn#"
cachedwithin="#request.timespan#">
CFinclude's <cfinclude
template="#request.cfroot#/template.cfm">
i use the web path and imagepath for cffile tags in content management tools
so once the site moves from home to demo or demo to production... IF there
are any datasource, cfmapping, or emails to change...they are only changed
here
----- Original Message -----
From: "Smith, Matthew P -CONT(DYN)" <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Friday, February 21, 2003 2:33 PM
Subject: easy path question
> I'd like to have an expression in Application.cfm that tells me the path
to
> the current site, basically the web path to the directory Appication.cfm
is
> in.
>
> So if we are in c:\interpub\wwwroot\subSite\Application.cfm
>
> And I call
>
> http://myserver.com/subSite/subdirectory/subsubDirectory/page.cfm
> <http://myserver.com/subSite/subdirectory/subsubDirectory/page.cfm>
>
> I would have a var available in Application.cfm that resolves to:
>
> /subSite/
>
> Hmm, seemed simple but I'm not explaining it well... Basically the web
path
> to Application.cfm, so I can set it to a var and append it like:
>
> #sitePath#subdirectory/subsubDirectory/page.cfm
>
> As the site may be moved to different directories.
>
> I know it's doable but mixing all the getBaseTemplateScriptNamePath
> functions gets tricky for me.
>
> Thanks!
>
> Matthew P. Smith
> Web Developer, Object Oriented
> Naval Education & Training Professional
> Development & Technology Center
> (NETPDTC)
> (850)452-1001 ext. 1245
> [EMAIL PROTECTED]
>
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription:
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Your ad could be here. Monies from ads go to support these lists and provide more
resources for the community. http://www.fusionauthority.com/ads.cfm
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4