EasyCFM.COM ColdFusion Forums / ColdFusion Applications / Help with relative paths and stylesheets

   Reply to Discussion | New Discussion << previous || next >> 
Posted By Discussion Topic: Help with relative paths and stylesheets

book mark this topic Printer-friendly Version  send this discussion to a friend  new posts last

jaahazz
10-01-2003 @ 4:25 PM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
New Member
Posts: 1
Joined: Oct 2003

Hi there,

I'm having 2 problems.

1.  Stylesheet info is not displaying correctly
2.  relative paths are not working properly (can't display images, also i get error messages which say "file not found").

Here's my web root path: C:/CFusion/wwwroot/mySite
Images path is: C:/CFusion/wwwroot/mySite/Images
Stylesheet path is: C:/CFusion/wwwroot/mySite/CSS/myStyles.css

In mySite I have: application.cfm, login.cfm and index.cfm.
I have a subfolder in mySite that contains all other templates.

I have a header file (header.htm) that contains my stylesheet link.  It is called in Application.cfm.

Thanks in advance.
jaahazz



apletfx
10-08-2003 @ 11:11 AM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
Moderator
Posts: 607
Joined: Nov 2002

image paths on the web will be from web root only, ie. images/filename.gif

Also, your path uses "/" to represent directories. on Windows hard paths are formated with "\" instead. like,
C:\CFusion\wwwroot\mySite

Since you are trying to get your images to display in a browser the path you should use is mySite/Images/filename.gif this is of course asuming that IIS thinks your web root starts in the wwwroot directory. same with your css,
mySite/CSS/myStyles.css


Mark Aplet
http://www.pixeljunkie.org

maquiladoras
10-24-2003 @ 7:09 PM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
Moderator
Posts: 2073
Joined: Dec 2002

though is really dependant on the site setup , unless you are using something like XP Pro's IIS that allows only the one Site and the rest are just virtual directories

like apletFX said, you should be usings images/filename.jpg

dependant on what the url is you can do it a number of different ways though, if you had an url of

http://127.0.0.1/mySite/

then you could do

<a href="/mySite/images/filename.jpg">

but if you have that ip address pointing at mySite already, all you'd do is something like

<a href="/images/filename.jpg">

if you have a decent IIS setup and a network card, my suggestion is whack a load of ipaddresses on and rather than just bundling your sites in to the webroot virtual server, make it so that you have individual websites

like

mySite could be on 192.168.0.6
where as your admin could be on 192.168.0.5

make sure you bind them to your network adapter first, and then specify it through IIS


--------------------------------------------------------------
Installing & Configuring & Administering Windows XP Professional 070-270
Friday 8th August 10am

--------------------------------------------------------------


Website Designed and Developed by Pablo Varando.