Site-wide Navigation
- Started
- Last post
- 6 Responses
- cramdesign
What is the best way to include a site-wide navigation and header across a big site?
1. Just html, same as usual? But that would be difficult to update.
2. Server side includes?
3. PHP include? This might be difficult because wouldn't I have to change all the file names to .php to get it to process?
4. Some sort of javascript solution? Is this even possible or smart? Seems like SSI or PHP would do this better though JS seems easier.I need to put a bandaid on about 400 pages to update the header so I want to do this the best way (and easiest to change again which will likely be soon).
Thanks
- dMullins0
PHP.
- Mimio0
You can also configure your server to process other page extensions as php.
- acescence0
^ in an htaccess file:
AddType application/x-httpd-php .html .htmnote that it will slow things down a bit as you're firing up the php engine to parse every .html page.
- cramdesign0
Is this how you would do it if starting clean as well? PHP includes? Or this seems the best considering that I need to change existing pages?
- cramdesign0
How much would it slow things down to process every page as php? Do you thing that is something that would be significant assuming a fair amount of traffic?
- acescence0
I would just do php includes. a lot of editors can do a find/replace across multiple files, so it shouldn't really take that long.
if you use php and get any amount of traffic, i would recommend using some sort of php op-code cache..