My solution:  

    Create a variable called directorylevel (dirlevel) in your 
application.cfm.  Make sure you have an application.cfm in every 
directory.  I don't make it an application variable. 

    Set the value like this:

Root:                dirlevel =  ""
Subdirectory level 1 dirlevel = "../"
Subdirectory level 2 dirlevel = "../../"

 Make sense thus far?  

 In your include, set your links up like this:

  <a href="#dirlevel#/subdirectorylevel1/page1.cfm">text</A>
  <a href="#dirlevel#/subdirectorylevel1/subdirectorylevel2/page1.cfm">text</A>
  <a href="#dirlevel#/subdirectorylevel1/page2.cfm">text</A>
   etc..


  The dirlevel variable, puts you back up to the root directory, and 
create all your links based on the location of the root directory.

  I actually don't use this sort of syntax for my includes too.  
I used to work with a developer who had the hardest time grasping
the directory mapping concept.  
 

Michael Wilson wrote:
> 
> Hi,
> 
> 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 navigation menu. I
> made a mapping in CF Admin with a logical path of /includes/ and Directory
> Path of C:\Inetpub\wwwroot\clients\mfay\includes which is where the file I
> want to include, leftnav.cfm is. Then I placed <cfinclude
> template="includes/lrftnav.cfm"> in my pages where I wanted the menu to
> appear.
> 
> I am not having a problem with the file showing up in my browser. I am
> having problems with the urls in the links of my menu. The site is split up
> into several directories and I want to include the menu in all the pages. Of
> course the links I have in leftnav.cfm work fine on the index.cfm or any
> .cfm in the root, but if I try and use it in another directory the links get
> all screwed up. It makes sense to me as to why they get messed up. I am just
> wondering if I need to do something I am overlooking to compensate for this.
> 
> Is CFINCLUDE meant to be used this way or do I have to replicate the
> includes directory inside every sub directory of my site?
> 
> Thanks for any help,
> 
> Mike
> 
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 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

-- 
Jeff Houser | mailto:[EMAIL PROTECTED]
AIM: Reboog711  | ICQ: 5246969 | Phone: 860-229-2781
--
Instant Cold Fusion 4.5  | ISBN: 0-07-213238-8   
Due out 3rd Quarter 2001
--
DotComIt, LLC
database driven web data using ColdFusion, Lotus Notes/Domino
--
Half of the Alternative Folk Acoustic Duo called Far Cry Fly 
http://www.farcryfly.com | http://www.mp3.com/FarCryFly
--
Does Everyone Think I'm a Cynical?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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