Ok.... let's review:

This:  [src="" not "include" anything in the page processing.  Instead it generates a separate
http request AFTER the page is downloaded to the browser. That second request goes to:

http://*whateverMyDomainIsCalled*.com/images/image1.jpg

This:  [<cfinclude template = "Client1/navbar.cfm"]  gets executed BEFORE the page is sent to the browser and actually
RUNS the code in the file at:

c:\*whateverTheCURRENTtemplateDirectoryIs*\Client1\navbar.cfm

So if you want to include something from the root which is at:

c:\wwwdocs\Client1\

And the template CALLING the included code is in C:wwwdocs\Client1\legal\ and you use

<cfinclude template="/client1/navbar.cfm">

the server first looks to see if there is a mapping for "/" in the cf settings.  If there is no mapping for "/", it then
looks to see if there is a directory (a folder) called /client1 in directory (folder) containing the Calling template
(the one in /legal/).  It never actually looks at the root of the WEBSITE because CF has no knowledge of those settings
IIS hands a request to CF, CF fills a buffer with stuff to send back and hands it back to IIS. That's how it works.

In the scenario that you present, and assuming you are using the default installation of CF, if you tried:

<cfincldue tamplate="/client1/navbar.cfm">
(what's a tamplate?)

the web server would try to include from the "/" mapping - usually the default web site directory - like
inetpub/wwwdocs.  If your web site is NOT the default web site on the server, or if the mapping has been removed (maybe
a good idea on a shared server), then you will throw an error.

If you tried <cfinclude template ="client1/navbar.cfm"> from the /legal/ directory - it would be looking for:

c:\*whateverTheCURRENTtemplateDirectoryIs*\legal\Client1\navbar.cfm

again it would fail.

There are only 2 ways to to call a file using CFINCLUDE  from (for example) c:\sites\mywebsites\client1\legal" that
resides in
c:\sites\mywebsites\client1\

1)  use the ubiquitous 2 periods to move back one dir

    <cfinclude template="../client1">

B)  Create a mapping in the cf administrator to use.  For example, if you created a mapping called /bob/ that pointed to
c:\sites\mywebsites\client1\ you could do <cfinclude template="/bob/navbar.cfm"> and it would work.. although it might
be a tradmark infringement.

I hope this helps.

Mark



  -----Original Message-----
  From: Jeff Small [mailto:[EMAIL PROTECTED]
  Sent: Thursday, March 25, 2004 1:56 PM
  To: CF-Talk
  Subject: Re: Okay, bear with me, I'm not even sure what I'm asking...

  ----- Original Message -----
  From: "Mark A. Kruger - CFG" <[EMAIL PROTECTED]>
  To: "CF-Talk" <[EMAIL PROTECTED]>
  Sent: Thursday, March 25, 2004 2:36 PM
  Subject: RE: Okay, bear with me, I'm not even sure what I'm asking...

  > Did I misunderstand this - I think he IS asking why he can't use
  <cfinclude> exaclty like he uses <img>... why <img
  > src="" works and why <cfinclude
  template="/images/blah.cfm"> doesn't... right? I don't think he's
  > asking how to use the image tag, I think he's asking how to get at the
  root using cfinclude - which IS germane to a cf
  > mapping.
  >

  Okay, see? I wasn't sure WHAT I was asking, but I knew I wasn't asking about
  using the image tag, lol.

  We've got several clients. They're all located this way.

  http://development.somedomain.com/client1/
  http://development.somedomain.com/client2/
  http://development.somedomain.com/client3/

  And say, under client1/ (which is located at C://InetPub/wwwroot/client1/
  logically) there are a couple of subdirectories (say client1/About/,
  client1/Contact/, client1/Products/, ) and for the index page in each
  directory, he'd like to use one include for footer/legal/link stuff in the
  root, or navigation include in the root (say for example Client1/navbar.cfm,
  and Client1/disclaimer.cfm) and in those directories, he wants to use
  absolute paths for the image directory in the root, so in his ONE include,
  he can say [src="" and it will work whether or not he's
  in the root, or in the lower (Products) directory.

  Make sense now?

  We'd like to have a "mapping" somehow for:
  http://development.somedomain.com/client1/
  http://development.somedomain.com/client2/
  http://development.somedomain.com/client3/

  That would make it the root of each site so we could use cfincludes in that
  manner. Is a CF-Mapping what I'm looking for?
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to