View Single Post
Old 09-11-2005, 21:31   #12
MikeyB
Inactive
 
MikeyB's Avatar
 
Join Date: Jun 2003
Location: Swindon
Age: 54
Services: BT FTTP, Humax Foxsat HDR Freesat+
Posts: 810
MikeyB has much to be proud ofMikeyB has much to be proud ofMikeyB has much to be proud ofMikeyB has much to be proud ofMikeyB has much to be proud ofMikeyB has much to be proud ofMikeyB has much to be proud ofMikeyB has much to be proud ofMikeyB has much to be proud ofMikeyB has much to be proud of
Exclamation Re: Wanted! Help from somebody who knows Dreamweaver or Frontpage!

Hi Lee,

Just having a quick look, but can't look at the file you sent me, I don't actually have Dreamweaver!!!!

But anyway, just looking at the source code on your website.


Quote:
Originally Posted by lsainsbury
Yes - I believe what I have created already is using frames - or was - but it's not working correctly. N ot being really into web design I'm not to sure whats going on or how to fix it!
You do not have a frame on your page, if you did have at some point, it's gone!!!

The menu is made up of the javascript between the <script type="text/javascript"> and </script> tags at the top, a few <divs>, and onmouseover events on the main menu headings.


I take what you want to do is to be able to have this menu on all pages, and be able to change it in one place only?

The most reliable way is to use includes like Zeph said.
You don't need PHP to do includes, they can be done in normal HTML (as long as your host allows it)
What you're looking for is Server Side Includes (SSI)

You may have to rename your html files to .shtml to get the include to work.

What you need to do is 1st make a file for the javascript, call it menu.js for example, and copy the code between the <script type="text/javascript"> and </script> tags, but do not include them in your file.
Completely remove the javascript (including the start & end tags) from your page, and replace it with <script type="text/javascript" src="menu.js"></script>
This will include the script from the menu.js file into your page.

Next you will need to create a 2nd file called menu.inc.
In here you need to copy the HTML code for the menu.
I would say copy from the line <div id="globalNav"> (line 56 from my "view source") down to the </div> (line 94) on the line before <!-- end masthead -->
and put this into your new file.

Now in your HTML (shtml) file, replace the lines you just copied with:
<!--#include file="menu.inc" -->

Now all you have to do is edit the menu.inc file and you've change the menu on all your pages

So you should end up with something like the 3 files I've attached (actually, why didn't I just say see the attached files in the 1st place???)


Hope that all makes sense!

Mike
MikeyB is offline   Reply With Quote