Multiple Menus on one page??

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
Post Reply
webmonkey8
Advanced
Advanced
Posts: 11
Joined: Fri Oct 03, 2003 10:30 pm

Multiple Menus on one page??

Post by webmonkey8 »

Hello, in your FAQ, I read that it is possible to implement more than one master menu on a page, either vertically and horizontally. Now, what is the best way of doing this? How do I go about doing this? Do I have to rename 'menu_data.js' to 'menu_data.js_02' and 'menu_data.js_03' and so on? Then call these files individually on a page? I don't want to get copies of these menus conflicting each other.
User avatar
John
 Team
 Team
Posts: 5967
Joined: Sun May 19, 2002 8:23 pm
Location: Phoenix, AZ
Contact:

Re: Multiple Menus on one page??

Post by John »

webmonkey8 wrote:Do I have to rename 'menu_data.js' to 'menu_data.js_02' and 'menu_data.js_03' and so on?
Having multiple menu_data files is fine, but not the way you have named them here. Doing that means they are no longer Javascript files as far as the system is concerned. You've taken away the .js suffix.

However, you could do something like menu_data01.js, menu_data02.js, etc. Actually the name can be anything you like (top_menu.js, side_menu.js), just as long as you don't mess with the .js at the end.

Whatever you use for a name, don't forget to change the call to match it.
John
User avatar
kevin3442
Milonic God
Milonic God
Posts: 2460
Joined: Sat Sep 07, 2002 12:09 am
Location: Lincoln, NE
Contact:

Post by kevin3442 »

Another approach would be to simply define all menus in one .js file (menu_data.js). I find that a rule of thumb that works for me is: use separate files if some of the main menus will be on some pages but not on others. Use one file if all of your main menus will always be on all pages; using one file in this case is easier, in my opinion, to maintain.

The key is this... there really are no "main menus" and "submenus." There are only menus. Any menu has the potential to be a "main menu". Any menu also has the potential to be a "sub menu" in that any menu can be opened from an item in any other menu. So what distinguishes between a main menu and a submenu? It's really all about the site user's perspective. A "main menu" is one that is already open when the page loads, and remains available to the user for as long as that page is loaded into the browser. A sub menu is one that is not already open when the page loads, but pops up from a different menu (or other trigger onject).

In the menu code, here's what that means: If you set a menu's alwaysvisible property to 1, and set its Top and Left location on the page, then that menu will be open when the page loads and will always be available to the user; hence, it is a "main menu". If a menu's alwaysvisible property is not enabled, then that menu will not be open when the page loads and will presumambly only be opened from another menu (or other trigger on the page); hence, it is a "submenu". You can have as many alwaysvisible menus on a page as you want... i.e., as many main menus on a page as you want. And they can all be defined in one file.

Hope that helps,

Kevin
webmonkey8
Advanced
Advanced
Posts: 11
Joined: Fri Oct 03, 2003 10:30 pm

tried renaming but won't work

Post by webmonkey8 »

Hello, I tried renaming the js. files to get more than one master menu on one page. A bizzare thing happens. My new master menu appears, my previous menu is gone, however, the new menu has my old menu's sub menus. :!: What's going on here? How can I fix this?

Can someone give me an example of how to implement more than one master menu on one page? I'd appreciate it!
By the way, my old menu is version 3.3.19 Menu3 and I want to put an additional menu using the Multiple Styles menu on the same page.
User avatar
John
 Team
 Team
Posts: 5967
Joined: Sun May 19, 2002 8:23 pm
Location: Phoenix, AZ
Contact:

Post by John »

Are you saying you're using 3.3.19 now :?:

Post a URL (as requested) so we can see what's going on.
John
Post Reply