Web Hosting Talk







View Full Version : Updating a huge website's navigation easily? How?


Junkie
03-12-2006, 11:00 AM
I'm designing a huge website with, at least 4 levels (subfolders). And I know that in a few months time, the owner is going to want to add a button or two to the navigation. When that time comes what will be the easiest way to update a navigation once and for all? I really don't want to go through like 50+ pages and update each and every one of them.

Ackoo-jt
03-12-2006, 12:04 PM
I would go with a CMS or just code your pages in PHP and use the php include function to bring in your header and footer. Thats usually the best way anyway.

sabian1982
03-13-2006, 07:40 AM
i always use include php files for my navigation, that way i just change the navigation.php file which is included on each and every page... that way i can update the navigation by editing just one single file! Simple!

TechnoBound
03-13-2006, 08:18 AM
I would go the php route, but iframes is always a nasty option.

Ducani
03-13-2006, 11:56 AM
Create the site using PHP includes for your navigation and any other area you feel will be changed fairly regularly or at all. This gives you the ability to edit one file to update the entire site.

doolittle
03-13-2006, 06:15 PM
I use DreamWeaver, and I have my navigation in a library file. Every page on the site references this library file. This is not an include file, the actual code of the menu does appear on every page. If I modify the library file containing the site navigation in DreamWeaver, then I am prompted to allow DreamWeaver to update each page that uses the library file I modify. I then need to upload the entire site to the web server. This works very well for me.

doolittle
03-13-2006, 06:21 PM
Junkie, I just noticed that you mentioned a "huge" website. So the php include method would be best for you. The DreamWeaver library files can be time consuming if you have to update & upload hundreds of pages.

Junkie
03-13-2006, 11:28 PM
Thanks for all the advice. I had a brain lapse and I totally forgot about using PHP includes. Though I'm still a bit new to PHP.

If I set up the website using PHP include files (ex for the header, footer, navigation, etc), when I go to update the navigation 5 months down the road... And I update the one PHP include file... how is it going to update every single webpage of the website if there are multiple levels in the site?

Seems like when the code for all the navigation links in the PHP include file is inserted into the actual webpage, it will only work for webpages one 1 level and not for all the other webpages deep in other subdirectories?

bluedreamer
03-14-2006, 04:11 PM
You might want to consider using a set of "includes" for your site

header - contains top area, logo, top nav etc
menu - your main nav menu
footer - the bottom bit

This means you can change each of them by changing one file.

For your multiple levels of navigation you can use as many "menu" includes as you like, ie nav_main, nav_section1, nav_section2 etc etc

A lot of work is done in the initial planning of the site, try mapping it all out on paper first using flow diagrams!

kapina
03-14-2006, 05:47 PM
What bluedreamer suggested above is quite a good way to do it. Kind of "poor man's template system". You still need to edit every file, but perhaps not in a long time if you plan it carefully.

I would suggest a simple CMS. If the site grows, that's the route you'll have to take eventually. And the more individual files you have, the more painful the transition is.

Ducani
04-17-2006, 01:16 PM
I use DreamWeaver, and I have my navigation in a library file. Every page on the site references this library file. This is not an include file, the actual code of the menu does appear on every page. If I modify the library file containing the site navigation in DreamWeaver, then I am prompted to allow DreamWeaver to update each page that uses the library file I modify. I then need to upload the entire site to the web server. This works very well for me.

For a large website, actually for any size website why would you want to have to update several files then upload several files when you could simply update one file that would update everything. I understand that it may seem easy to do it this way, if you arent familiar with coding or if your website is composed of static pages but otherwise include files would be recomended.

e-zone
04-17-2006, 02:29 PM
Lets say you create a file called navigation.php

You put in all the navigation code you have into that file! and upload it to the root where you have your main files.

Now you have to edit every single file on the server, and replace the navigation code with this php code: <? include("navigation.php") ?>

If the file is in a sub-folder you have to replace the
navigation with this: <? include("../navigation.php") ?>

root/sub-folder/

Every time you go deeper into a folder you have to add an extra ../

Every time a file is requested it makes a call to navigation.php that includes the links in the file.

Remember that all your files that uses this, has to have the extention .php