Forum Moderators: phranque

Message Too Old, No Replies

virtual include for multiple subdirectories

images on include file not displaying after 2nd level

         

Pricey

12:58 pm on Oct 22, 2003 (gmt 0)

10+ Year Member



lo,

I'm currently in the process of re-structuring my website into multiple subdirectories. It used to be all be based in the root directory, with directories for images, style sheets & javascript files.

Now its all very well editing each page to make up for the new directories, the only problem is that I was originally using file includes for my navigation.

Now I have gotten round my first level of directories by making the include a virtual one (

<!--#include virtual="/nav.shtml" -->
), using absolute linking for the images. Level 2 however, seems to include the file but it won't display the images... I'v tried using absolute linking by specifying the domain and not ie.

<img src="/images/other/foo.jpg">

and
<img src="http://www.mydomain.com/images/other/foo.jpg">

I can't get either option to work. The last thing I want to do is make an include page for each directory level. Is there a simple answer?

bakedjake

11:35 pm on Oct 22, 2003 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



Can you call the image by itself in the address bar? It almost sounds like the image isn't residing where you expect it to be.

Pricey

8:42 am on Oct 23, 2003 (gmt 0)

10+ Year Member



Yes I can. All the images are in the correct directory, so I can type in [mydomain.com...] and see the image.

I have a feeling its something to do with the include file constantly being set as

<!--#include virtual="/nav.shtml" -->
even when its 2 levels deep. Should I be using
<!--#include virtual="/../nav.shtml" -->
or something similar?

Or does anyone know if there is something I can universally use to specify the root directory?

Pricey

9:09 am on Oct 23, 2003 (gmt 0)

10+ Year Member



Gah!

/me slaps himself

Ok, I worked it out. My code is flawless, my test directory however, is set up off my main directory (which has my old site on it) So the page I was telling it to include WAS in the root directory, but not in my test directory. It was picking up my current include page, which does not have the images set as absolute!

/me whacks himself again. \o/