View Full Version : Menu help
chumpster
08-06-2008, 09:37 PM
My site has a menu running horizontal. It is presently inside each html file. I want to take the menu out of every page so I can save pace and ultimately edit it without having to update 50+ pages manually.
Can you help?
TheJoshMan
08-06-2008, 09:43 PM
sounds like a job for PHP to me... You could just have an "include" in each page which would include the menu, then you could edit the menu directly and the changes would be apparent in each page.
chumpster
08-06-2008, 09:47 PM
So how would I need to format the two files?
Do I just put the include in place of the menu in each html? What would I include?
TheJoshMan
08-06-2008, 09:59 PM
Make a php file, put all the menu source code in it, then save it as "menu.php" or something to that effect. Then use an include() to show that file in that particular area of each page.
You can read more about includes below:
http://www.w3schools.com/php/php_includes.asp
Medyman
08-07-2008, 12:49 PM
It doesn't have to be another PHP file that you include. It can be HTML (or a text file). Of course, it makes no difference in this case.
What's important is that the file in which the include is going into be renamed with a .php extension.
Also, be aware that the entire file will get "included". So, only but the code related to the menu. Don't include any other <head> or <body> etc.. tags.
chumpster
08-07-2008, 04:04 PM
Have been unable to get it working following the instructions on the websites listed above. Not sure if I have got everything installed properly to run php stuff.
With that in mind I have now edited one of 'mouseovertabs.js' as available from this site. I have cut down as much of the JS as possible given my none scripting background. I now have a working menu in my pages that is loaded from a single file. I can now make changes to just one file and apply it across the entire site in one go.
PS I have left the reference to this page at the top of the JS file.
As I am not from a scripting background is there anyone on here who can have a look at the file to remove any parts that are unused so as to reduce size of the file?
TheJoshMan
08-07-2008, 05:26 PM
Sorry you couldn't get the include() working, but glad to hear you were able to come up with some sort of solution. Would you mind posting your results for us to see?
chumpster
08-08-2008, 11:29 AM
What would you need me to upload and how?
TheJoshMan
08-08-2008, 04:16 PM
well, for us to be able to view the finished product, you would need to upload the page (pages) that you want us to see, plus all the images, scripts, css, and so forth.
TheJoshMan
08-08-2008, 04:16 PM
It's not a MUST however, I was just wondering if you would mind if we could see the end result.
Powered by vBulletin® Version 4.2.2 Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.