Rick,

That is correct behaviour, and you need to think that this is looking for a
file in the current directory. If the current directory is not your virtual
directory then it is not going to find the file.

The link is relative to the browsers path, cfinclude is relative to the
current physical directory.

Regards,
Andrew Scott


-----Original Message-----
From: Rick Faircloth [mailto:[email protected]] 
Sent: Sunday, 18 July 2010 6:49 AM
To: cf-talk
Subject: Problem with file path...


Hi, all.

Ok, I've got a folder set up under my webroot named "hphomes".

I've got another folder under my webroot named "real_estate_common".

In IIS, I've created a virtual directory in the hphomes directory called
"real_estate_common".

I thought that all paths created for any file inside the virtual directory
would be created as though the virtual directory were actually inside the
webroot, "hphomes"...

However, this works:

<link type="text/css" rel="stylesheet" href="../css/hphGlobal.css">

But, this does not:

<cfinclude template = "../css/conditionalCSSChrome.cfm">

Are relative paths treated different for an include as opposed to a css
link?

Both "hphGlobal.css" and "conditionalCSSChrome.cfm" are in the same physical
directory.

Both are being referenced from a file inside the virtual directory.

However, "hphGlobal.css" is being found, but "conditionalCSChrome.cfm"
is not being found.

I have to use <cfinclude template =
"../hphomes/css/conditionalCSSChrome.cfm">
or <cfinclude template = "/hphomes/css/conditionalCSSChrome.cfm"> to make
this work.

???

Why is this happening?

Thanks for any clarification!

Rick





~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:335447
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

Reply via email to