CPressland Posted July 15, 2010 Share Posted July 15, 2010 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 More sharing options...
0 Plarkster Posted July 15, 2010 Share Posted July 15, 2010 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 More sharing options...
0 motomotomd Posted July 15, 2010 Share Posted July 15, 2010 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 More sharing options...
0 CPressland Posted July 15, 2010 Author Share Posted July 15, 2010 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 More sharing options...
0 CrossCheck Posted July 15, 2010 Share Posted July 15, 2010 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 Link to comment Share on other sites More sharing options...
0 Descartes Posted July 15, 2010 Share Posted July 15, 2010 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 More sharing options...
0 CPressland Posted July 15, 2010 Author Share Posted July 15, 2010 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 More sharing options...
0 Guest Posted July 15, 2010 Share Posted July 15, 2010 PHP is the way to go. Link to comment Share on other sites More sharing options...
0 Dick Montage Posted July 15, 2010 Share Posted July 15, 2010 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 More sharing options...
0 AnthonySterling Posted July 15, 2010 Share Posted July 15, 2010 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'! Link to comment Share on other sites More sharing options...
0 CPressland Posted July 15, 2010 Author Share Posted July 15, 2010 Say wha'? Crazy foo'! How you doing man? Link to comment Share on other sites More sharing options...
0 Cupcakes Posted July 15, 2010 Share Posted July 15, 2010 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 More sharing options...
0 CPressland Posted July 19, 2010 Author Share Posted July 19, 2010 Hey Guys, Sorry to bother all of you on this again but I tried the PHP include script and it didn't work. Please overview these files and tell me what I'm doing wrong... http://cpressland.com/intranet/ Thanks Chris Link to comment Share on other sites More sharing options...
0 DeathLace Posted July 19, 2010 Share Posted July 19, 2010 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 More sharing options...
0 Colin-uk Veteran Posted July 19, 2010 Veteran Share Posted July 19, 2010 you could also use server side includes if your web server supports it. Link to comment Share on other sites More sharing options...
0 CPressland Posted July 19, 2010 Author Share Posted July 19, 2010 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 More sharing options...
Question
CPressland
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