navigation – absolute or relative

Good day all.

Currently along the way of building an online site and there exists a section of the pages that happen to be common on most pages.

At this point, if I am for the home page of the website the links will probably be something like

< the href=" subfolder/" title=" subfolder" > foo< /a> : < a href=" subfolder2/" title=" subfolder2" > bar< /a> < the href=" etc/" title=" etc" > etc< /a>

However from the index. html file from the directory I cannot have same href values given it would look regarding subfolder/subfolder2 and subfolder/etc…

Therefore, I just chose to have a distinct navigation. inc file that is inside subfolder, subfolder2, etc.

Extravagance (although quite unlikely) on this is if I want to to add your link only for the subfolder2 links I could truthfully without affecting additional pages.

However (and dont worry this is my question) – does one approve of a great deal of duplication in this code Or does one rather I experienced one navigation. inc file plus just absolute tracks I ask mainly because I heard there’s a bit of a server hit utilizing absolute paths in lieu of relative.

Thanks for virtually every input

What if you used. htaccess to be able to process your. html code files as PHP…

Then use some PHP scripting to undertake relative paths from
whichever directory it exists (automatically). No issue where
a person put " listing. html", it would likely work properly.

We’d think it’s more efficient to use PHP instead of absolute addressing,
and you’ll have some strong advantages for other uses.

mlseim :

This is a possibility and the one that I did certainly not give much idea purely because you will find not many sub directories, it possibly seems abit overkill.

Easily follow you I’d ohave one map-reading. inc and then inside each directory (which features a index. html that also includes the navigation. inc file) We’d have some PHP computer code to detect the directory after which you can write the appropriate paths.

That seems worthwhile.


It would also be for things including,
displaying the correct year in the actual footer copyright brand.
feasible background changes.
manipulation from the files in the actual directory, such seeing that listing them, relocating them, etc.

The cope with your situation of directories…
Linked to this: http: //us3. php. net/dirname

I’m not very technical – so this are sometimes a noddy answer — but I believed that html might handle navigation by using subdirectories We’ve had trouble when utilizing javascript, but Expression makes it possible for us to automatically add footers that work if you are in the subdirectory or possibly not. Our submenu package – Opencube — also works using this method.

This entry was posted in Web Design and tagged , , , , , , , , , . Bookmark the permalink.

Related Posts

Leave a Reply

Your email address will not be published. Required fields are marked *