• 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
https://www.neowin.net/forum/topic/920590-menu-bar-in-separate-html-file/
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! :)

  • 0
  On 15/07/2010 at 11:05, Plarkster said:

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

  • 0
  On 15/07/2010 at 11:12, CrossCheck said:

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

  On 15/07/2010 at 11:15, Kuraj said:

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

  • 0
  Quote
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

  • 0
  On 15/07/2010 at 11:12, CrossCheck said:

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

Say wha'? Crazy foo'!

  • 0
  On 15/07/2010 at 11:12, CrossCheck said:

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.

  • 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 :)

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

    • No registered users viewing this page.