Log in

View Full Version : Menu and navigation



Maynard
10-28-2008, 10:15 PM
Greetings master coders...

I am tired of searching for something the eludes me. I may have in idea what I want to do is only available as a PHP item, but before I stop looking I will finally ask.

I want a menu / navigation that I only have to code once (as you know, you used to do this with frames by keeping on frame static with all the menu links and the other frame with the content, now that frames are out, I tried iframes, not working like the old frames did)

It is not a matter of reloading the menu every time. That has never been an issue.
the reason I only want one menu to have to write is changing 140+ pages with the menu in it when I create a new menu item or change one.

If it were just one menu to change and it loads for all pages (like frames used to) then that is what I am looking.

PHP? someone mentioned AJAX (looked at it and did not fit the needs), javascript? Looked at a few of those and I understand javascript is just as bad as frames?

anyone with an idea? anyone doing this now? I see it on many sites, and look at the code, but there is alot going on, either Javascript or ???

and no. I will not do druple or joomla.

Medyman
10-29-2008, 12:47 AM
PHP, or some other server-side script would be your best option. There are JavaScript solutions to this, but they're buggy and unreliable at best (not to mention inaccessible).

Here (http://dynamicdrive.com/forums/showthread.php?t=28260) is a small tutorial on creating PHP templates. In short though, all you would do is code your menu, add it to it's own .html page (for example, menu.html) and then "include" it into your main PHP page. "Include"ing means:


<?php include('menu.html'); ?>

You would have to rename all of your pages with the .php extension for this to work, however. Or do some .htaccess magic and instruct your server to parse HTML as if they were PHP.