HTML - Pulldown Menu That Reads From External File
Hello!
I'll be using an HTML pulldown menu system for a website, where the menu links are for pages on that website. Easy enough! But....when I add webpages to the website, I'll have to edit the HTML of the menu on each and every webpage to incorporate the new link. Again, easy enough, but time consuming. So I need a system where the pulldown menu looks to an external file for it's links - then, all I have to do is edit one file instead of editing every webpage. Can anyone help? (BTW - I wasn't sure what board to post this in, so if it needs moving to client-side or server-side, that's cool). Similar TutorialsHi guys, im trying to setup a simple website for my football team and ive run intio a small problem. I originally had the Navigation code on every page but started to get annoying when i wanted to make changes etc. So by following the FAQ he http://bonrouge.com/~faq#includes I thought id found the answer to my problem but i cant seem to get it to work. The below code is contained in a file called menu.htm <div id="navigation"> <h2>Navigation</h2> <ul> <li><a href="home.htm">Home</a></li> <li><a href="squad.htm">Squad</a></li> <li><a href="fixtures.htm">Fixtures</a></li> <li><a href="matchReport.htm">Match Reports</a></li> <li><a href="news.htm">News</a></li> <li><a href="sponsorship.htm">Sponsorship</a></li> <li><a href="motm.htm">Man of the Match</a></li> <li><a href="forum.htm">Forum</a></li> </div> My code for the first page called "home.htm" is as follows <!--<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> --> <html> <head> <title>Pavilion FC</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <link href="myCSS.css" rel="stylesheet" type="text/css"> </head> <body> <div id="logo"> <h1></h1> <p> </p> </div> <!--#include file="menu.html"--> </body> </html> Is this code meant to have the comments round it? Should it be in the HTML or CSS file? I also tried converting the files to PHP and usign the line <?php include 'menu.php'; ?> but that didnt seem to work either. Both times the menu just doesnt appear. Im using firefox to view the files offline before uploading, so that id upload it anyway to see if php needed to be enabled or soemthing but still doesnt work. I created a pulldown menu using the target=_self command and that wiorkes fine, the list open when clicking on the menu. My question is: is there a way to get this menu to retract upon clicking in the link again? and how do I proceede? Hi, I have implemented 3 pull down menus to my website each calling a different method. Each pulldown menu has a series of values that lead the user to another site. My problem is that the only way they work is to right click on the popup blocker bar at the top of the page to allow popups. This is a problem because I need to implement it into a sharepoint webpart and the pages can not be blocked by a pop up blocker. Is there a way to make the sites come up that are in the pulldown menu without a popup window??..that way they wont get blocked?? here is my html: header: function formHandler0(form) { var URL = document.form0.site0.options[document.form0.site0.selectedIndex].value; window.location.href = URL; } body: <input type=button value="Go" onClick="javascript:formHandler1(this)" target="_self" style="border: 2px ridge #FF9900"> How can get a free program that lets be use movies hosted on other site such as youtube and put them on mine while still hosted at the other site. Its kinda a set-up like on game websites but for videos. like this http://cruiseshipfan.webs.com/apps/videos/ the only ones i have been able to find have to be hosted at the site but i don't want that. Hello, I've tried looking everywhere, yet have drawn a blank on this idea. I'm currently building a website that needs a vertical menu put onto it, for access to various categories. However, the key issue is that this menu needs to be easily edited in the future (i.e not by me), so it would need to be controlled by some sort of external file, where new categories could be added or edited, and then the changes would automatically apply to the whole website. The website is being built soley in HTML, so I really need something that could be used with this. Please can anyone help? Hi there, I've got an example xml page that I'm trying to separate into tidier pices (eg separate files for stylesheets, xsl, xml etc). However I don't know how to separate the xml file? Normally in html it's just something like with stylesheets/javascript etc: <script>script here</script> turns into <script src="external.js"></script> But that doesn't work with xml it appears, so can anyone tell me how I can remove the bit in <xml> ... </xml> to an external file and get it loading from that external file...? I have an html application consisted of a number of html files, js files and css files. Is it possible to have an external property file where I can keep the name of the server so as to use a variable for the urls? For example to have something there like nameOfTheUrl=andreana and in the html file to have something like http://nameOfTheUrl/content/index.html My server has java but it is not a servlet container so I can not use jsp. Can an image map be stored externally, and read in, when an image is read in? For my current project, I will have 67 different image maps, but for my next project, that will increase to 125 different image maps. George ok so to start off if I ask any dumb questions my apologizes. I have just started writing HTML code. I have done quite a bit of C++ but its been years and html is much different. Well here is my question I have made a dynamic sidebar for my webpages so I can cut out all those blocky link buttons at the top of the page. So I created an external html file and wrote the code for the side bar, but I can't figure out how to get it into my webpage html files. I am sure its something minor but I can't seem to figure it out. I have been able to get it on the page by using iframe but I really don't like iframe. One of the really big things is I want it locked to the right side of the browser screen so if you scroll it stays there. Also it needs to float above everything else so it will open on top of the webpage and no disrupt the content. I am sorry if this is a simple thing but I have spent 2 days reading everything I can on it and can't get it to work. I have tried it as a PHP file with include command. I tried link didn't work also. I know I could just include all the code on the pages but I am trying to learn how to use template correctly so as to make my pages as clean and SE friendly as possible. Last thing if I need to post some of the code up here to help I can do that. Well thanks in advance, this will make my day if I get this dang side bar to work. Thanks J Hi I use an include to display an exteral html file in a div. If I strip the html file of all the header formatting, it displays fine. As soon as I add the header info, transitional info etc, it adds a couple of blank line breaks to the top of the text dsiplayed in the external div. How do I make it so the text starts at the top? Cheers Shaun Hi guys, I have a div on my page, which essentially just places a layer/table over the entire page and displays a "LOADING..." message, then promptly disappears when everything hidden beneath it has finished loading. I want to use this same div in several other pages, so I thought the best way would be to place it in an external file, then simply call it when required. Can someone please tell me how I can do this, i.e. what code I need to place in my HTML script to call an external div? I apologise if this is an obvious newbie-style question! But I appreciate any help that anyone out there can give me. Thanks in advance, Kate. Hi I have the following code loading an external .txt file into a DIV <?php $content = file_get_contents($_SERVER['DOCUMENT_ROOT']."/text_files/about_text.rtf"); echo htmlspecialchars($content); ?> It loads, but the line breaks are ignored, so it appears as one continous string of words. How do I make the html display the text file's line breaks? Thanks for your time and info Shaun Hi I use an include to display an exteral html file in a div. If I strip the html file of all the header formatting, it displays fine. As soon as I add the header info, transitional info etc, it adds a couple of blank line breaks to the top of the text dsiplayed in the external div. here's the link:www.mcbub.com How do I make it so the text starts at the top? thanks in advance! Greetings and thanks for checking my question out. I oversee an academic site for mostly text at www.zeitschrift.co.uk and when I recently updated it with new material, specifically at www.zeitschrift.co.uk/v4n1jryskamp, it will not seat properly in the browser window, but this page seems to work ok with explorer. Does anyone have any suggestions. Much appreciated, HTML Dad How do I Link text in a div, h1, h2, p to an external text file or xml file - I don't really know how to ask the question. I think I need an xml file that can be easily edited by a user saved to the server to update an xhtml page text without the user getting bogged down in html. I don't want to use joomla or cms. <Any ideas />? Best wishes, mas Hi, I have a php include menu on my website, which will link to pages in different folders and subdomains. However I don't know how to make it work on all pages because the root folder will be different, as pages are in a lot of different places. e.g. index.php for the homepage doesn't work for pages out of the main folder. As the same menu will be included on all pages, it will have to work for all folders and subdomains. I've tried absolute paths e.g. /home/username/public_html/....file which doesn't work. the only way I have found to work is http://www.pagelocation.. I didn't really want to use that way though. can anyone offer any help? thanks The website I am working on has been constructed all with html, css, and javascript - it is currently not hosted at this point. On each page there is a menu on the left side that has all the links. I am looking for a way that I could update all of these links by updating just one file. The left side code is essentially: Code: <div id="links"> <table> ---- </table> <table> ---- </table> </div> I was thinking javascript could do this, but I don't have enough know-how to do this. Hello again, I have just spent hours adding a script to all my pages for drop down menus and have run into a problem I have no idea how to fix. The menus won't drop down over the top of the swf files I have on two of my pages. Everything else works perfect, it's just these two pages and one happens to be my homepage. I know someone out there will have the answer. This forum hasnt let me down yet! Can a kind person please offer me advice on how to fix this or even tell me how to fix it. My page is ozlotteriesonline.net if you need to view it. Thanks in advance I have a youtube video on front of the school website and a horizontal dropdown menu just slightly above it. What is happening is when i hover over a menu item the drop down menu is going under the youtube video. But this is only happening on IE but not firefox http://www.rosebridge.wigan.sch.uk Does anyone have a idea? I have lots of computers that aren't connected to the internet. I am not making a web page, but I think I can use Internet Explorer and HTML to help me with something. The users will be installing software on the PC with a CD with a batch file that I have made. There is a point where I need to tell the user "plug in device now and close this window when you have finished" and other messages like that. I was thinking of just making a simple .html file that sits on the CD and when I come to that point in the installation just call the appropriate file to display the message. So, in notepad, I am trying to make a .html file that when executed (like double clicked or called from the batch file) will be a small window with the menus disabled and simply displays the message. If there is a better way to display a message to the user, please let me know. Maybe what I want is called a message box? Thanks for sharing your expertise. |