June 11, 200818 yr Hi again everyone. Can anyone advise me. I want to call an html document that contains a drop down menu, into another html page that is a page in the site. What I have tried to do, props very crudely, is create a drop down menu bar that I can use accross the entire site, and if I need to edit this menu, I only have to do it once as the file that contains it is called upon from each page in the site, if you know what i mean. So I have created the menu html file, now I want to call upon it in each page of my site. What is the command I need to add into the main pages to call and run the menu file. Thanks fella
June 11, 200818 yr I think what you are looking for is a iFrame code. very simple. Search Google or wait for another designer to post. Sorry in a rush to get out. Sorry
June 11, 200818 yr If you are able to use php in your site you could use a php include http://www.webdesignerforum.co.uk/index.ph...ic=2036&hl= that thread will help you out
June 11, 200818 yr Just as a note, Iframes are a bad idea, to use at any time within a design. But especially when it comes to a drop down menu, as you have to specify the height of the iframe so your dropdown will not be shown in some browsers due to the iframe stopping, so you will make the site unusable for some
June 11, 200818 yr Author So php is the only decent alternative. Do both the destination file and menu file have to be in php?
June 11, 200818 yr So php is the only decent alternative. Do both the destination file and menu file have to be in php? both files have to have a php filename, but both can just be regular html files inside.
June 11, 200818 yr Author both files have to have a php filename, but both can just be regular html files inside. Perfect mate, Thanks........to everyone
June 11, 200818 yr both files have to have a php filename, but both can just be regular html files inside. Not quite An "include" file can have any file extension so long as the format associated with that extension is a text file. Examples would be php, html, txt, inc. All an include does is literally "take the contents of this file and put it here" - the actual content can be plain text, or html
June 11, 200818 yr Including the HTML presents all sort of code / layout problems. You's also include tags like <html> <head> <body>. Found an intresting topic on this subject here http://drupal.org/node/40756 Might be drupal related but still might be informative if you really don't wanna use iframes
June 11, 200818 yr Not quite An "include" file can have any file extension so long as the format associated with that extension is a text file. Examples would be php, html, txt, inc. All an include does is literally "take the contents of this file and put it here" - the actual content can be plain text, or html Thanks for that Bluedreamer - I have wondered from time to time if that may be the case...
June 11, 200818 yr Including the HTML presents all sort of code / layout problems. You's also include tags like <html> <head> <body>. Found an intresting topic on this subject here http://drupal.org/node/40756 Might be drupal related but still might be informative if you really don't wanna use iframes This doesn't apply in this situation. The OP only wants to include a menu, not an entire website. As long as they don't include extra (unnecessary) html/head/body tags in the drop down menu file there will not be any conflicting tags/etc. In fact, if done with PHP the user won't even realise that the page is constructed from multiple files.
June 11, 200818 yr Author In that case would I just take off the html, head and body tags from the the dropdown menu file, save it as a php and then add: <?php include("drop down menu.php"); ?> into my index.html file?
June 11, 200818 yr The index file needs to be saved as php, but yes, that's the general idea. (Although its bad practise to have spaces in filenames)
June 11, 200818 yr Author The index file needs to be saved as php, but yes, that's the general idea. (Although its bad practise to have spaces in filenames) Thanks for the tip friend
June 11, 200818 yr Author When I try and view the index.php file in my browser (I'm using notepad++ to script) It just opens the file in MS Notepad, not IE. The HTML version opens fine in the browser, whats the problem with the PHP file do you think?
June 11, 200818 yr php is a server side script to be able to see the page you will need to run it from something as a browser cannot do this itself, so it will either have to be uploaded onto your site, or you could use a local host such as XAMPP to replicated a server.
June 12, 200818 yr Author php is a server side script to be able to see the page you will need to run it from something as a browser cannot do this itself, so it will either have to be uploaded onto your site, or you could use a local host such as XAMPP to replicated a server. Thanks for that. You just saved me alot of stressing. Big up
June 13, 200818 yr Author Thanks everyone. I just tried the php include command and it works beautiful. Thanks again, a new skill learnt
Create an account or sign in to comment