Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Navigation Common file

Status
Not open for further replies.

bloise

Programmer
Jun 21, 2001
67
US
I have created a navigation html file that contains rollover images, logos and such. I include this in muliple pages throughout my site directory. The navigation file is in the home or root directory.

All works fine in the first page, however when I go to the second page, in another directory, I lose all my images. The include html is there, however all the images are lost.

Thanks,
Mike
 
How are you calling the images in the other directories? In most cases, the images are in a sub-directory in the same directory as your index (home) page. When using pages that reside in other directories, you have to use a qualified path to the images and any other files you're using.

There's always a better way. The fun is trying to find it!
 
Yes,

The images are in a directory called graphics which exist in the main root directory. I have trying mucking around with the image source, (i.e. ../graphics/theimage.gif

When I change this it works for one directory structure but not the others. The nav page is also in the root directory.

It almost seems that I need to dynamically link the images depending on where I am at.

Any suggestions...
Thanks,
Mike
 
If your include file is going to be used in multiple documents in mutilple directories, you should probably always reference the images by their absolute url.

e.g. src="
Sometimes a url will break if it's referenced with too many "steps" (e.g. src="../../dir/whatever.ext")

Cheers!
 
Thanks for the hint. But what happens when you move this from your developement site to production site. The URLS might be different.

Mike
 
Thanks all for your responses and info. I actually redesigned the structure of my site using a modified fusebox technology and it all seems to work fine now.

Mike
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top