PDA

View Full Version : Website Coding - Navigation Bars


bluemicrobyte
11-26-2005, 3:42 PM
Whats the best way to make a navigation bar that appears on every page of your site? Currently all of my pages are .html and I just copy/paste the nav bar to every page. My idea is to make the nav bar a separate html document that just contains the nav bar table then use PHP to "include" the nav bar on every page --

<?php include 'sitewide/nav-left.html'; ?>

I've tested this and it works, but are there any disadvantages to having all of my pages end in .php and have the above code used to insert the navbar on each page?

Or is there a better way to make a navigation bar for my site that is easy to update sitewide?

Seal
11-26-2005, 4:13 PM
that's kinda the best. you might only suffer from very minor performance loss because of PHP, but that's it. the other method is pretty much SSI, Server Side Includes.

bluemicrobyte
11-26-2005, 4:15 PM
SSI sounds complex.... I think I'll stick with PHP unless someone recomends otherwise.

The main question is: is there any disadvantage to having ALL My pages end in .php

Sikawtic
11-26-2005, 5:15 PM
Um, can you include html codes in CSS?

Something like

body { html text; }

and include the sheet as the style sheet on everypage?

Neo
11-26-2005, 5:29 PM
SSI sounds complex.... I think I'll stick with PHP unless someone recomends otherwise.

The main question is: is there any disadvantage to having ALL My pages end in .php
Not really...

I made a tutorial that you might find semi-useful (i dont think it was great but it was recieved well...).

and no, .php pages don't really matter.

http://www.soulestudios.com/forums/viewtopic.php?t=49

-Neo

pixels
11-26-2005, 6:07 PM
ssi owns

<!--#include file="header.html" -->

Neo
11-26-2005, 6:33 PM
ssi owns

<!--#include file="header.html" -->
SSI is crappy. PHP is more powerful. And if you need to use PHP code... you can stuff it in the same file.

Plus I believe that SSI puts undue stress on the server.

-Neo

TimP
11-26-2005, 7:25 PM
The only disadvantage is the slight overhead in PHP processing each page.

AJ
11-26-2005, 7:27 PM
SSI has a much higher misrender percentage due to browser compatibilities.

pixels
11-26-2005, 7:34 PM
ha, okay. fine.

but when your homemade server doesnt [didnt] have php, ssi is great :)