Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

HTML Forum


You are currently viewing our HTML Forum as a guest. Please register to participate.
Login



Post a Project »

Find a Professional HTML Freelancer!

Find a Freelancer to help you with your HTML projects

FREE Outsourcing eBook!

Reply
Links within an Included File
Old 10-01-2007, 06:07 PM Relative Links within an Included File
Vye
Junior Talker

Posts: 2
Name: Mike
Trades: 0
I am trying to have a Navigation Bar that I include into every page on my site. All the NavBar files are in a directory, then I use a

<!--#include file="NavBar/Navigation.html"-->

to call it.

It works fine on the main index page, but once I go into a different directory, say Information for example, and try to include that file
<!--#include file="../NavBar/Navigation.html"-->
It shows all the tables and everything correctly, but anything in the Navigation.html file that has a source such as:
<img src="spacer.gif"

or

<img name="FullNavBar_r2_c1" src="NavBar/FullNavBar_r2_c1.gif"

The sources will be trying to find the images in the Information direction, not the NavBar one. The only way I can think of to fix it is to put those images in every single directory.. which I really don't want to do

Last edited by Vye; 10-01-2007 at 07:07 PM..
Vye is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 10-01-2007, 07:14 PM Re: Links within an Included File
Vye
Junior Talker

Posts: 2
Name: Mike
Trades: 0
Simply put, I need to know how to use relative links that will work no matter where I include the file.
Vye is offline
Reply With Quote
View Public Profile
 
Old 10-01-2007, 07:59 PM Re: Links within an Included File
Defies a Status

Posts: 1,606
Trades: 0
I am tired. I read it twice and I am going to answer what I think you asked. Will throw out a couple of responses.

I never managed to get one menu to work on my site. I wound up using two (two levels deep). One for the pages that were in the main directory and one for the deeper pages.

For each directory level you go down you need to add one ../

The same thing is true for linked images or linked anything including the css file.

The alternative to the above is to use absolute path to the files.

Did I help or confuse?
__________________
Colbyt

Please login or register to view this content. Registration is FREE
colbyt is offline
Reply With Quote
View Public Profile
 
Old 10-01-2007, 08:36 PM Re: Links within an Included File
maxxximus's Avatar
Extreme Talker

Posts: 219
Name: Rob
Location: UK
Trades: 0
You need to use a Root relative path. Rewrite <imgsrc="spacer.gif" /> with a forward slash at the beginning <img src="/spacer.gif" />. This will always be the same path wherever it is used.
maxxximus is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Links within an Included File
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.55435 seconds with 12 queries