> Still new to CF so forgive me if this question seems sort of 
> retarded... I am trying to use CFINCLUDE in my site to include my left 
[ snip]
> Is CFINCLUDE meant to be used this way or do I have to replicate the
> includes directory inside every sub directory of my site?


Skimmed your post, but hope this helps.

In the "Application.cfm" file, I create two application (or request)
variables like this:

<CFPARAM NAME="application.WebserverMapping" DEFAULT="/">
<CFPARAM NAME="application.ColdFusionMapping" DEFAULT="/thisapp/">

Then in the CF Administrator, add a ColdFusion mapping for just that one
site of "/thisapp/" to whatever the root directory of that website is
(obviously if you don't have access to the Administrator or can't ask for
this, this one's a no go).

Whenever you write a link to an other page on your site, do it like this:

<A HREF="#application.WebserverMapping#login/index.cfm">Login!</A>

and submit FORMs like this

<FORM ACTION="#application.WebserverMapping#somedir/subdir/mailform.cfm"
METHOD="post">

and if you want to reference a CFINCLUDE or CFMODULE, you can do this:

<CFINCLUDE
TEMPLATE="#application.ColdFusionMapping#includes/GetCountries.cfm">


Works like a charm.

You can even move an entire application into the subdirectory of another...
all you need to do is alter the two application or request variables, update
CF Admin and you're good to go.

I don't think I've built a site that uses relative (../) style references in
ages since I was shown this method. All of them take the root directory of
the site as the starting point.


One slight drawback... this method isn't quite so good if you the type who
changes directory names every five minutes.

Mind you, searching and replacing on
#application.WeberserverMapping#somedir/ within a project isn't really that
difficult.


BTW, when you develop you're site on a local box, you have to change
127.0.0.1 in your webserver (PWS, Apache or whatever) to point to the root
directory of the site you are working on and change it every time you switch
projects.

-- 
Aidan Whitehall <[EMAIL PROTECTED]>
Netshopper UK Ltd
Advanced Web Solutions & Services

http://www.netshopperuk.com/
Telephone +44 (01744) 648650
Fax +44 (01744) 648651
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to