If you were to use fusebox style methodology, you would put those
variables in app_locals.cfm. It's already been stated that mappings are
not the answer, but that's what I use - much cleaner.

-----Original Message-----
From: Jeffry Houser [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, September 25, 2001 3:18 PM
To: CF-Talk
Subject: Re: Absolute Path Usage


At 08:51 AM 09/25/2001 -0700, you wrote:
>See below...
>
>----- Original Message -----
>From: "Jeffry Houser" <[EMAIL PROTECTED]>
>To: "CF-Talk" <[EMAIL PROTECTED]>
>Sent: Tuesday, September 25, 2001 11:30 AM
>Subject: Re: Absolute Path Usage
>
>
> >   I didn't see the original post, so I'm jumping in the middle.
>..
> >   The way I do this is by setting a variable ( Either to the local
scope
>or
> > the request scope ) in the application.cfm called DirLevel:
> >
> > Root:             Dirlevel = ""
> >   Sub1            Direvel = "../"
> >    SubSub1:    Dirlevel = "../../"
> >   Sub2            Dirlevel = "../
> >
> >
> >   When you create your include, make all the paths relative to the
root
> > directory and add dirlevel in there.
> >
> > <A HREF="#dirlevel#index.cfm">Home</A>
> > <A HREF="#dirlevel#sub1/page1.cfm">Page 1</A>
> > etc.. etc..
> >
> >   This makes it easy, and I do it all the time.
> >   One potential problem is that you'll need different
application.cfm for
> > each directory.
>
>This technique may be useful in some cases, although I'm not sure that
it's
>worth it.  I'll probably just stick to hardcoding the ../../  etc
levels in
>each CFINCLUDE statement.
>Thanks for the tip!

  I have grown quite fond of this technique, although I haven't found a
way 
of dealing with multiple Application.cfms that I'm completely happy 
with.  I would either break off the pertinent application.cfm lines into
a 
separate include and include them into all the Application.cfms or do 
something like this:

    <CFINCLUDE "../application.cfm">
    <CFSET dirlevel = "../">

  I haven't decided which way is 'better' or 'worse' .



> >
> > >I have tried a variety of absolute paths and find none that work.
If
>anyone
> > >can shed some light on this...my host shares the CF server so
asking them
>to
> > >configure a mapping for "/" is not going to happen since it would
only
>work
> > >for my domain and not for all the other domains they host.
> >
> >    You can always get to the exact root directory (I.E.
www.mysite.com/ )
> > by using the slash.  So the code I wrote above could easily be
re-written
>like:
> >
> > <A HREF="/index.cfm">Home</A>
> > <A HREF="/sub1/page1.cfm">Page 1</A>
> >
> >   And the browser sees the '/' and automatically adds it to the end
of the
> > url, such as www.mysite.com/index.cfm for the first link.  Try it;
It
> > works.  However, if the root directory of your application is not
the root
> > directory of your server, that won't work.
>
>It may work for <A HREF> but not for <CFINCLUDE template=> tag.  That
is the
>whole point of my discussion.  CFINCLUDE is very picky...it appears it
ONLY
>sees relative paths or paths specified in the server mapping file.
That's
>IT!  How I wish it recognized "/" as the web root, meaning the
placeholder
>or representative location for http://www.mydomain.com/.

  That's good to know, since I'm pretty stuck to the 'dirlevel' theory
I've 
never experienced it.


--
Jeffry Houser | mailto:[EMAIL PROTECTED]
AIM: Reboog711  | ICQ: 5246969 | Fax / Phone: 860-223-7946
--
I'm looking for a room-mate in the Hartford CT area, starting in October
--
DotComIt: Database Driven Web Data
My Book: Instant ColdFusion 5.0  | http://www.instantcoldfusion.com
--
Far Cry Fly, Alternative Folk Rock
http://www.farcryfly.com | http://www.mp3.com/FarCryFly
--
A friend is someone who knows how to spell your name.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Get the mailserver that powers this list at http://www.coolfusion.com
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to