• 0

Menu Bar in Separate HTML File


Question

Hey guys,

We're currently building an Intranet from scratch at work and for simplicity reasons would like the Menu Bar in a separate HTML File so that if we've gotta add anything we won't need to make that change in EVERY file.

Any assistance on this would be great.

Thanks Guys

Chris Pressland

Link to comment
Share on other sites

15 answers to this question

Recommended Posts

  • 0

I've never been involved with intranets, but have use simple includes on websites to keep the menu separate. This site has lots of info.

The only problem I had was that I couldn't preview the site on my computer as the includes didn't work because they're server side. Don't know how it will affect intranet.

Hope that helps!

Edit: lol @ my eliteness! :)

Link to comment
Share on other sites

  • 0

As with the comment made above, using PHP or similar language to include the file in question is usually what I do. If your web server doesn't support PHP or similar, then you could always try using an IFrame...

Link to comment
Share on other sites

  • 0

I've never been involved with intranets, but have use simple includes on websites to keep the menu separate. This site has lots of info.

The only problem I had was that I couldn't preview the site on my computer as the includes didn't work because they're server side. Don't know how it will affect intranet.

Hope that helps!

Edit: lol @ my eliteness! :)

Lengend, Thanks dude

Link to comment
Share on other sites

  • 0

If your server supports PHP, you can use the include function:

<?php include "menubar.html";?>

Please don't use frames, they're really not meant to serve as a part of the site's layout, and they'll most likely just **** off your visitors.

Link to comment
Share on other sites

  • 0

why are you using html......lil dated are we. you could use frames and put your menu in a frame so basically you are viewing 2 html pages in the same browser tab. http://www.w3.org/TR/REC-html40/present/frames.html

Because it's the standard Web language? lmao

If your server supports PHP, you can use the include function:

<?php include "menubar.html";?>

Please don't use frames, they're really not meant to serve as a part of the site's layout, and they'll most likely just **** off your visitors.

+1, frames are the single most evil thing in history!

Will use that PHP script

Link to comment
Share on other sites

  • 0
why are you using html......lil dated are we. you could use frames and put your menu in a frame so basically you are viewing 2 html pages in the same browser tab. http://www.w3.org/TR...ent/frames.html

1) HTML is STILL the language web pages are coded in (or at least a version of HTML - XHTML or HTML5 for example). This has never changed. If you are referring to scripting languages such as ASP, PHP and so on - you are barking up the wrong tree.

2) You talk about HTML being dated then suggest frames of all things? Wow...

Sorry, you tried to condescend and then utterly failed and showed how little you know. Take your attitude elsewhere.

To the OP:

Save the file as "mainmenu.html" and them simply include it as show above (assuming you have access to PHP or ASP). Else read here: http://www.google.co.uk/search?q=include+file+using+javascript&ie=utf-8&oe=utf-8&aq=t&client=firefox-a&rlz=1R1GGLL_en-GB___GB377

Link to comment
Share on other sites

  • 0

why are you using html......lil dated are we. you could use frames and put your menu in a frame so basically you are viewing 2 html pages in the same browser tab. http://www.w3.org/TR/REC-html40/present/frames.html

LOL wow that made my day; Thank you!

That being said: HTML is still a web language that is being used and will always be used. Might want to read up on HTMl5.

PS - Frames are so 1999.

Link to comment
Share on other sites

  • 0

Vegetunks,

You have the right idea, but the file that is running the PHP script must be of type .php, not .html like you currently have it. This way your web server knows to run the file as a PHP file, allowing it to run PHP commands.

Your web server will need to have PHP installed, most do, but rename the file first to newmenu.php and we'll go from there :)

Link to comment
Share on other sites

  • 0

I'm such an idiot sometimes... I always use PHP files, as this is somebody else's work I didn't even THINK to look at the extension.

Thanks Guys, FIXED!

Now to update every file, one down, three hundred to go.

Link to comment
Share on other sites

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.