Forum Moderators: coopster
I'm using a CSS/Javascript driven menu on a site. If changes are needed to be made I want to be able to make them accross the whole site without having to go into each individual page to make the changes one by one. The most logical way of doing this seems to do it server side.
My question(s) to you:
What would be the best, quickest and easiest way to do this.
I will keep the nav markup and css in it's own file. If I were to use an PHP would it need to be a .php file? Or would it be that every page that used the include need to be .php.
The site is hosted on an Apache server, and supports both SSI and PHP. I've heard that PHP is more flexible.
If I used PHP would <?php include="nav.htm"?> do the trick?
Since all my files are .htm right now would 'AddHandler server-parsed .shtml' still do the trick?
Thanks.
'AddHandler server-parsed .shtml' won't work because only .shtml pages will be parsed. You will need to change it to 'AddHandler server-parsed .htm' if that's what all your pages are named. After that, you can use
<!--#include virtual="/absolute/path/to/include_file.htm" --> on each of your pages to pull in the nav and styles. (I would also suggest separating the nav markup and css into 2 files, and include the nav css with <link rel="stylesheet" type="text/css" href="/path/to/css.css" /> and include the nav with the SSI).
With SSI, I could include files, but not integrate my scripts properly. I just like having everything on one system.