I have a website I am working, on and am fairly new to web design. The Website is www.BlakeStoltman.com If you go to my site you will see a navigation bar on the left side with topics. Now that is going to be shown on every page only the content in the center will change. I am currently using a template in Dreamweaver so when I add topics it runs through all of my html docs, and updates the nav bar on the side to the same. But then I have to upload my entire site again. This is tedious, a waste of bandwith, and will not work if my site becomes larger. I am not ready to adding databases and such. Eventually I will probably use Joomla but for now, is there a way to put the navigation bar html into a seperate file that each page just grabs it a master document, so I only have to change and upload for example a Navigation.html or .CSS or something. I don't want to use frames either that is horribly annoying for users. Thanks Blake
I'm not sure if you'll like this answer or not but might as well do it now before your site gets any bigger. I'd recommend that you change your pages to .php pages and then make the navigation bar a file include. This way it will show up across the whole site and you will only have to change and upload a small file in order to update the entire site. Assuming you're on a linux server. If you're on Windows, you can make them .asp pages and do something similar.
nicknick beat me to this answer. PHP templates are definitely the way to go here, assuming that your server supports this. To implement this, firstly you will have to change all of your pages so that they end in an .php extension as opposed to .htm or .html. Remember to find and replace all links on the site to correspond to these file name changes. You will then have to manually change the navigation bar code in all of the pages to a line of php include code (this can be done fairly quickly using the find and replace function in Dreamweaver). Then you simply copy and paste the navigation bar into a new document, let's say "navigation_bar.html" The code that would replace all of the navigation bar code in all of your pages would look something like this: <?php include("navigation_bar.html"); ?> Code (markup): Hope that helps!
Alright I have done as you have said, and can get either one by to work or the other but not both at the sametime. My problems is my entire site uses this sidemenu. and when I set it up so the pages in the main folder are working then the ones in a folder don't and I switch some of the locations with ../ prior then some will work the but the other won't. Currently going from a page from the localhost into a page in researchers directory works fine, but clicking a link while on a researchers page fails. Help! Example Directory Localhost: index.php links.php sidemenu.php /researchers davidicke.php jordanmaxwell.php /media /ruledbygods ruledbygods.php All of this php files reference the same sidemenu.php within the localhost directory, but They can't all get to it at the same time. sidemenu.php <a href="researchers/tedgunderson.php">Ted Gunderson </a><br /> <a href="researchers/lenhorowitz.php">Len Horowitz</a><br /> <a href="researchers/davidicke.php">David Icke</a><br /> <a href="researchers/alexjones.php">Alex Jones</a><br /> <a href="../researchers/texemarrs.php">Texe Marrs</a><br /> <a href="researchers/jordanmaxwell.php">Jordan Maxwell</a><br /> <a href="researchers/cathyobrien.php">Cathy O'Brien</a><br /> <a href="researchers/philipschneider.php">Philip Schneider</a><br /> <a href="researchers/billschnoebelen.php">Bill Schnoebelen</a><br /> <a href="researchers/fritzspringmeier.php">Fritz Springmeier</a><br /> <a href="researchers/michaeltsarion.php">Michael Tsarion</a> PS. I use WAMP to test my site.
If you need to use the menu across the whole site and in subfolders, the easiest thing to do is to make your links absolute. So, instead of: mylink.php you would use http://www.mysite.com/mylink.php
But how do I test my site properly while using Wamp. my Online site is not the same place as my test area.
I'm not really sure what WAMP is since I've never used it but here is something else that you can do. I would just put the menu live on the site with the full URIs and it would work just fine but... You can make two files if you don't want to take it to the live site. One file for the main site and one for any sub folders. The only difference in the menu is that any pages in the main directory would reference the files normally and you would set up a second menu file. Call it submenu.php or something and everything there there would reference the files relative to a subdirectory with the ../ The other thing you can do is make a test page on your live site. Call it index2.php or something and check all the links from there before putting it on the public site. If the links are absolute with the full domain name in front, there is no reason why you should have any problems at all if they all work from your test page. Plus most servers will show index.html before index.php so you could switch over your whole site, test it and no one would know it's there until you deleted the html pages. I'm kind of rambling here. I hope that all makes sense. If you need any help, let me know.