Web Development Thread, Menu on everyweb page. in Coding and Web Development; I've found some nice navigation menu's, but the problem i cannot get my head around is how do have the ...
-
6th July 2006, 10:15 AM #1 Menu on everyweb page.
I've found some nice navigation menu's, but the problem i cannot get my head around is how do have the menu on everypage?
Its a horazontal menu, so first i thought how about a frame,so the top of the page does not change. Then a problem comes that when the menu expands its covered up by the other frame. I cannot put the code in the body of everypage as when i update a link on the menu i would have to change it on every page on the whole site.
How should i go about it?
-
-
IDG Tech News
-
6th July 2006, 10:20 AM #2
- Rep Power
- 0
Re: Menu on everyweb page.
You could use Server Side Includes or some easy PHP to just include some HTML in every page.
The PHP method is very simple if your web server supports it, most should do!
Change the extension of your page to .php and save the HTML that makes up your menu in a separate file (eg menu.txt).
In the page where you would like the menu to appear insert the following:
PHP Code:
<? include_once("path/to/menu.txt"); ?>
Upload your page and that should do it!
-
-
6th July 2006, 10:25 AM #3 Re: Menu on everyweb page.
library element in dreamweaver works for me, add the menu to everypage and only have to edit one file - the library element, very similar to above php solution.
-
-
6th July 2006, 10:26 AM #4 Re: Menu on everyweb page.
If you don't have anything server-side that supports this you could use JavaScript. The only disadvantage are the people who disable javascript.
-
-
6th July 2006, 10:28 AM #5 Re: Menu on everyweb page.
I use this on my school website.
http://www.milonic.com/
You can use it for free or subscribe if you want. You just add code to each website and add a few files and away you go. Text file based admin too so its a piece of cake.
If this is of no use then please ignore everything I have just said and pretend I wasn't here.
-
-
6th July 2006, 10:29 AM #6 Re: Menu on everyweb page.

Originally Posted by
indie You could use Server Side Includes or some easy PHP to just include some HTML in every page.
The PHP method is very simple if your web server supports it, most should do!
Change the extension of your page to .php and save the HTML that makes up your menu in a separate file (eg menu.txt).
In the page where you would like the menu to appear insert the following:
PHP Code:
<? include_once("path/to/menu.txt"); ?>
Upload your page and that should do it!
So lets say i'm using IIS6. All the <body> menu stuff save as .txt instead of a .htm file, then at the start of every web page i make put PHP Code:
<? include_once("path/to/menu.txt"); ?>
and save as .php instead of .htm? Simple as that? I do not have to turn some settings on IIS on to allow PHP or somthing?
-
-
6th July 2006, 10:34 AM #7
- Rep Power
- 0
Re: Menu on everyweb page.
Ahh, you'll have to install PHP and set IIS up to use it, fairly simple though, have a look here.
Your <BODY> tag should stay in your main page, just put the HTML that actually makes up your menu into the includes file.
Depends on where you want your menu to appear, if you literally want it to be at the top of a page then yeah add the "<? include_once("path/to/menu.txt"); ?>" below your first <BODY> tag, if not add it inside whichever tag you want to place it by.
For example, I've added a menu inside a cell in a table so i've used the following code:
Code:
<td width="10" background="furniture/greybar.gif"></td>
<td width="150" background="furniture/greybar.gif">
<? include_once("includes/indexleftlinks.txt"); ?>
</td> Remember to actually change "path/to/menu.txt" to whatever file you're including!
-
-
6th July 2006, 10:37 AM #8 Re: Menu on everyweb page.
If you're using IIS you will have ASP (Active Server Pages) functionality which will allow includes. Name your pages with the .asp extension.
To run ASP includes, you simply need to do this:
page.html:
Code:
<html>
<head>
...
</head>
<body>
This is a web page. The menu should be above.</p>
</body>
</html>
The important bit is the #include section.
-
-
6th July 2006, 10:38 AM #9
- Rep Power
- 0
Re: Menu on everyweb page.
Good point webman, didn't think about that, can you tell i'm an Apache bastard? :P
-
-
6th July 2006, 10:39 AM #10 Re: Menu on everyweb page.
If you're using dreamweaver you can use a template to accomplish this - add the menu to the template, apply the template to every page.. you only have to update the template menu and then reapply it to the pages when you need to make changes...
NVU also has a template function that looks similar to dw although I havn't used it myself yet....
-
-
6th July 2006, 10:51 AM #11 Re: Menu on everyweb page.
Got it working now thanks, now i can spend the rest of the day locked in my office with dreamweaver.
-
-
7th July 2006, 11:50 AM #12 Re: Menu on everyweb page.
Does this ASP thing make a meal out of style sheets? I have my menu.htm and my default.asp. Load either one (both have the same style sheet in use) and it looks as it should correct font sizes.
Merge them using the ASP thing and certain fonts go bold or bigger text. I do not understand why, as they are both using the same .css file! I've tried just have the menu.htm with a style sheet, just default.asp with a style sheet. Nothing seems to fix it.
As soon as i pop this code in the default.asp
<html>
<head>
</head>
<body>
</body>
</html>
both pages are in the right position, just not the right font sizes!
-
-
7th July 2006, 12:00 PM #13 Re: Menu on everyweb page.
Are you able to post links to these two files at all or upload them to the thread as .txt files?
-
-
7th July 2006, 12:13 PM #14 Re: Menu on everyweb page.
http://www.chesterton-high.net/new/default.asp is the "merged" page.
http://www.chesterton-high.net/new/menu.htm is the menu page by its self.
http://www.chesterton-high.net/new/defaultown.asp is identical to default.asp but without the first few lines of code out telling it to load menu.htm
If you load menu.htm or defaultown.asp they load as i want. Load the "merged" copy and some of the menu fonts go bigger and stuff.
I'm only playing with it at the moment, but i'm not going any further content wise until i can stop it changing the font!
-
-
7th July 2006, 12:22 PM #15 Re: Menu on everyweb page.
That would be because the menu page includes the HTML tags, and then so does the main page so are conflicting.
As the menu is included in each page, it does not need the HTML tags for head, body, title, style etc - just the DIVs for the menu.
-
SHARE: 
Similar Threads
-
By FN-GM in forum EduGeek Joomla 1.0 Package
Replies: 24
Last Post: 8th December 2007, 11:48 PM
-
By russdev in forum General EduGeek News/Announcements
Replies: 0
Last Post: 16th April 2006, 06:00 PM
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules