Would the request.cfroot not need to be set in the app_locals file since it
has to do with that particular application? I get everything else fine.
We'll probably add a test server in the mix and make the check for a
production server first since that's where performance matters the most.
Phil
-----Original Message-----
From: Marc Gadsdon [mailto:[EMAIL PROTECTED]]
Sent: Monday, July 24, 2000 7:09 AM
To: [EMAIL PROTECTED]
Subject: RE: Images with nested fuseboxes
>>Thanks to all for the suggestions. request.imagesroot sound like a winner!
Please forgive me for asking this as I should probably already know...what's
the use for cfroot and webroot?
When using cfinclude or cfmodule you must use a relative path, whilst href's
and img tags are better off with absolute paths so as your code becomes
portable. Therefore cfroot will be the root directory that your app sits in
relative to the '/' mapping in CF Administrator, and webroot will be the
absolute path to your app. If you are developing, your webroot path will
probably be something like http://mydevserver.mydomain.com/theapp/ whilst if
your app is on a production server then the path will most likely be
http://www.theapp.com
Here is what we do in app_globals.cfm:
<!---setup application params--->
<cfapplication name="myapp" sessionmanagement="no" clientmanagement="no"
setclientcookies="no" >
<!---Constants--->
<!---define VARs for server names - change according to your
environment--->
<cfset dev_server = "http://mydevserver.com">
<cfset production_server = "www.myapp.com">
<!---Make it easy to move from you dev server to your production
server--->
<cfif #cgi.server_name# IS '#dev_server#'>
<cfset request.webroot = "http://#dev_server#/myapp/">
<cfelseif #cgi.server_name# IS '#production_server#'>
<cfset request.webroot = "http://#production_server#/">
<cfelse>
<cfabort>
</cfif>
<!---Set the VAR used for includes and modules--->
<cfset request.cfroot = "/myapp/">
<!---define VAR for images - use diferent server for improved
performance--->
<cfset request.image_path = "#request.webroot#images/">
<!---define VAR for blocks path--->
<cfset request.blocks_path = "#request.cfroot#blocks/">
Then in index.cfm an include would look like:
<cfinclude template="#request.cfroot#dsp_main.cfm">
Whilst on a dsp page in the root directory an href would look like:
<a href="#request.webroot#index.cfm?fuseaction=showsub">show</a>
HTH
Marc
----------------------------------------------------------------------------
--
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/fusebox or
send a message to [EMAIL PROTECTED] with 'unsubscribe' in
the body.
------------------------------------------------------------------------------
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/fusebox or send a
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.