Milonic provide full featured pull down web menus for some of the worlds largest companies
click here to see what it can do for you

Download Milonic DHTML Menu
Buy Milonic DHTML Menu

Back To Start Of Archive
Taken From The Forum: Help & Support for DHTML Menu Version 5+
Forum Topic: Click to view post
Last Updated: Saturday July 14 2012 - 06:07:04

Displaying 2 Menus on One Page


Poster: anthonyaykut
Dated: Sunday October 12 2003 - 18:55:44 BST

Hiya All,

OK here is my problem - I have just bought v5, and I don't know how to display 2 (vertical) menus on one page. One is no problem and it works like a charm, but the second menu shows up like a blank space (where the menu should be). I've searched in the forums here but I didn't see anything relevant as far I can see, a lot of references to menu_array.js, but I guess this is for older versions?? Can someone please help me on the right path??

Thanks in advance,

Anthony Aykut
Frame4 Security Systems
http://www.frame4.com/


Poster: Maz
Dated: Sunday October 12 2003 - 22:35:56 BST

The most important thing about 2 menus is adding a new name to each menu, listing the scripts after milonic-src.js on the html page and changing the style names so that each menu displays correctly under the correct style. There are a few posts on this if you do a search.

I'll have more time to look over it later.
maz


Poster: John
Dated: Sunday October 12 2003 - 23:00:45 BST

Where exactly in your code is the call for the second menu, and where exactly should it be showing on your page? I am tired, but I can't find it!

Also, the other JS menu calls should be the first items after the <body> tag, and the call to the menu data should be the only item in the <td>.


Poster: Maz
Dated: Monday October 13 2003 - 6:26:38 BST

I don't use flash and have an older browser, so it keeps telling me that I can't see the menu system, but it appears the menus are working.

I get a conflict between the submenu and the ticker tape. Sometimes it goes underneath or on top then the ticker tape goes blank, not a big problem considering the old browser with flash off. If it is a problem might be better to put the ticker tape not so close to the menu/subs.

Interesting,
maz


Poster: anthonyaykut
Dated: Monday October 13 2003 - 8:54:34 BST

maz - I noticed that as well, with IE5, the menu falls under the ticker tape, but with IE6, it seems to be OK. I will look into the cosmetics of this for my site. I was actually planning to do a drop-down menu instead

jgillett - you dont see the second menu, as it is "hidden". In the Admin mode I see all menu's and all blocks. I have two menu "blocks", one menu block with the login boxes underneath, and the other without (showing when user logged in) - as Admin I can see all blocks, thus displaying both blocks at the same time on screen. Here is big screen shot - the site is a bit up/down at the moment but you will see what I mean on bottom right... or I can email the file, 199kb big! (Edit : I just did...)

http://www.frame4.com/exchange/menu-sample.png

As far as the files concerned, do I have to have 2 menu_data files, like:

menu_data1.js with...
...
with(menuStyle1=new mm_style()){
...
style=menuStyle1;

AND a

menu_data2.js with...
...
with(menuStyle2=new mm_style()){
...
style=menuStyle2;

or do both

with(menuStyle1=new mm_style()){
with(menuStyle2=new mm_style()){

get defined in the same menu_data.js (how to display in the html in this case) - sorry for being anoob about this :oops:

Anthony


Poster: bzeitner
Dated: Monday October 13 2003 - 12:35:56 BST

One quick question: Are the menu's positioned relatively or absolutely?

If they are absolute, then all the information can be put in one datafile. If they are relative, or one is relative and another is absolute, then it's easier to put them in separate datafiles and call the one you need where you want it.

Beware, though, if only one of the menus is going to be used by you or the 'Admin' mode, then be wary of putting both menus in one datafile. This causes unnecessary overhead, as the visitors will have to download all that extra code, even if it's not being rendered.


Poster: anthonyaykut
Dated: Monday October 13 2003 - 12:55:24 BST

They are both positioned relatively, as this works best for me (ie position of blocks may change so I cannot use top/left)...

My menu_off.js file (shortened):

Code:
menuCloseDelay=100           // The time delay for menus to remain visible on mouse out
_menuOpenDelay=50             // The time delay before menus open on mouse over
_followSpeed=5                // Follow scrolling speed
_followRate=40                // Follow scrolling Rate
_subOffsetTop=10              // Sub menu top offset
_subOffsetLeft=-10            // Sub menu left offset
_scrollAmount=3               // Only needed for Netscape 4.x
_scrollDelay=20               // Only needed for Netcsape 4.x

with(menuStyleOff=new mm_style()){
onbgcolor="#000000";
oncolor="#ffffff";
offbgcolor="#ededed";
offcolor="#000000";
bordercolor="#000000";
borderstyle="solid";
borderwidth=1;
separatorcolor="#000000";
separatorsize="1";
padding=5;
fontsize="9px";
fontstyle="normal";
fontfamily="Verdana, Arial, Helvetica, Swiss";
pagecolor="black";
pagebgcolor="#ededed";
headercolor="#000000";
headerbgcolor="#ffffff";
//subimage="arrow.gif";
//subimagepadding="2";
//overfilter="Fade(duration=0.2);Alpha(opacity=90);Shadow(color='#777777', Direction=135, Strength=5)";
overfilter="Fade(duration=0.0);Alpha(opacity=90);";
//outfilter="randomdissolve(duration=0.3)";
}

with(milonic=new menuname("Main Menu")){
style=menuStyleOff;
position="relative";
alwaysvisible=1;
itemwidth=130;
aI("text=Home;url=index.php;status=Back to Frame4 Home Page;");
aI("text=About Us;url=modules.php?name=About_Us;status=About Us;");
aI("text=Editorial;url=modules.php?name=Editorial;status=Editorial;");
aI("text=Search;url=modules.php?name=Search;status=Search;");
aI("text=Products;showmenu=Products;status=Products;");
aI("text=Services;showmenu=Services;status=Services;");
aI("text=Resources;showmenu=Resources;status=Resources;");
aI("text=Forums;url=modules.php?name=Forums;status=Forums;");
aI("text=E-Shop;showmenu=E-Shop;status=E-Shop;");
aI("text=Site Map;url=modules.php?name=Site_Map;status=Site Map;");
aI("text=Feedback;url=modules.php?name=Feedback;status=Feedback;");
aI("text=Company Info;showmenu=Company;status=Company Information;");
aI("text=Contact;url=modules.php?name=Contact;status=Contact;");
}

with(milonic=new menuname("Products")){
style=menuStyleOff;
itemwidth=130;
overflow="scroll";
aI("text=Security Products;url=modules.php?name=Products;status=Security Products;");
aI("text=Product Support;url=modules.php?name=Support;status=Product Support;");
aI("text=Support Forums;url=modules.php?name=Forums&file=index&c=14;status=Support Forums;");
}

drawMenus();


My menu_on.js file (shortened):
Code:
_menuCloseDelay=100           // The time delay for menus to remain visible on mouse out
_menuOpenDelay=50             // The time delay before menus open on mouse over
_followSpeed=5                // Follow scrolling speed
_followRate=40                // Follow scrolling Rate
_subOffsetTop=10              // Sub menu top offset
_subOffsetLeft=-10            // Sub menu left offset
_scrollAmount=3               // Only needed for Netscape 4.x
_scrollDelay=20               // Only needed for Netcsape 4.x

with(menuStyleOn=new mm_style()){
onbgcolor="#000000";
oncolor="#ffffff";
offbgcolor="#ededed";
offcolor="#000000";
bordercolor="#000000";
borderstyle="solid";
borderwidth=1;
separatorcolor="#000000";
separatorsize="1";
padding=5;
fontsize="9px";
fontstyle="normal";
fontfamily="Verdana, Arial, Helvetica, Swiss";
pagecolor="black";
pagebgcolor="#ededed";
headercolor="#000000";
headerbgcolor="#ffffff";
//subimage="arrow.gif";
//subimagepadding="2";
//overfilter="Fade(duration=0.2);Alpha(opacity=90);Shadow(color='#777777', Direction=135, Strength=5)";
overfilter="Fade(duration=0.0);Alpha(opacity=90);";
//outfilter="randomdissolve(duration=0.3)";
}

with(milonic=new menuname("Main Menu")){
style=menuStyleOn;
position="relative";
alwaysvisible=1;
itemwidth=130;
aI("text=Home;url=index.php;status=Back to Frame4 Home Page;");
aI("text=About Us;url=modules.php?name=About_Us;status=About Us;");
aI("text=Editorial;url=modules.php?name=Editorial;status=Editorial;");
aI("text=Search;url=modules.php?name=Search;status=Search;");
aI("text=Products;showmenu=Products;status=Products;");
aI("text=Services;showmenu=Services;status=Services;");
aI("text=Resources;showmenu=Resources;status=Resources;");
aI("text=Forums;url=modules.php?name=Forums;status=Forums;");
aI("text=E-Shop;showmenu=E-Shop;status=E-Shop;");
aI("text=Site Map;url=modules.php?name=Site_Map;status=Site Map;");
aI("text=Feedback;url=modules.php?name=Feedback;status=Feedback;");
aI("text=Company Info;showmenu=Company;status=Company Information;");
aI("text=Contact;url=modules.php?name=Contact;status=Contact;");
}

drawMenus();


Then I call them from PHP- the only thing that is different is that there is no head/body tags and the <SCRIPT> definitions are inside the <TABLE><TD>... tags. I dunno if you are familiar with PHP but I am building an HTML echo from PHP that gets echoed as HTML at runtime...
One menu works so you would think that 2 would be no bother either?? Or should I try getting the definitions out of the <TABLE><TD>... and put it before it?? There are head/body tags though, the first tag in my PHP script is <center>, and then <table><td>... like this...

Code:
//STUFF REMOVED

$PATH_TO="includes/Menu";
$content .= "";
$content .= "<CENTER><br><TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 NAME=\"contents\"><TR><td>";
$content .= "

<SCRIPT language='JavaScript' src='$PATH_TO/milonic_src.js' type='text/javascript'></SCRIPT>
<script   language='JavaScript'>
if(ns4)_d.write('<scr'+'ipt language=JavaScript src=$PATH_TO/mmenuns4.js><\/scr'+'ipt>')
  else _d.write('<scr'+'ipt language=JavaScript src=$PATH_TO/mmenudom.js><\/scr'+'ipt>')
</script>
<SCRIPT language='JavaScript' src='$PATH_TO/menu_on.js' type='text/javascript'></SCRIPT>
<noscript>
<strong>Main Menu</strong><br>
<strong><big>.</big></strong> <a href=\"http://www.frame4.com/php/index.php\">Home</a><br>
<strong><big>.</big></strong> <a href=\"modules.php?name=About_Us\">About Us</a><br>
<strong><big>.</big></strong> <a href=\"modules.php?name=Editorial\">Editorial</a><br>
<strong><big>.</big></strong> <a href=\"modules.php?name=Search\">Search</a><br>
<strong><big>.</big></strong> <a href=\"modules.php?name=Forums\">Forums</a><br>
<strong><big>.</big></strong> <a href=\"modules.php?name=Site_Map\">Site Map</a><br>
<strong><big>.</big></strong> <a href=\"modules.php?name=Feedback\">Feedback</a><br>
<strong><big>.</big></strong> <a href=\"modules.php?name=Contact\">Contact</a><br>
<br>
<strong>Products</strong><br>
<strong><big>.</big></strong> <a href=\"modules.php?name=Products\">Security Products</a><br>
<strong><big>.</big></strong> <a href=\"modules.php?name=Support\">Product Support</a><br>
<strong><big>.</big></strong> <a href=\"modules.php?name=Forums&file=index&c=14\">Support Forums</a><br>
<br>
<strong>Services</strong><br>
<strong><big>.</big></strong> <a href=\"modules.php?name=Services\">Security Services</a><br>
<strong><big>.</big></strong> <a href=\"modules.php?name=Training\">Security Training</a><br>
<strong><big>.</big></strong> <a href=\"modules.php?name=Premium\">Premium Services</a><br>
<br>
<strong>Resources</strong><br>
<strong><big>.</big></strong> <a href=\"modules.php?name=Bookmarks\">Bookmarks</a><br>
<strong><big>.</big></strong> <a href=\"modules.php?name=Forums\">Forums</a><br>
<strong><big>.</big></strong> <a href=\"modules.php?name=Content\">Publications Archive</a><br>
<strong><big>.</big></strong> <a href=\"http://www.frame4.com/kbase/index.php\" target=\"_blank\">Knowledge Base</a><br>
<strong><big>.</big></strong> <a href=\"modules.php?name=Stories_Archive\">Stories Archive</a><br>
<strong><big>.</big></strong> <a href=\"modules.php?name=Industry_News\">Industry News</a><br>
<strong><big>.</big></strong> <a href=\"modules.php?name=Bugtraq\">Bugtraq</a><br>
<strong><big>.</big></strong> <a href=\"modules.php?name=Virus_Info\">Virus Information</a><br>
<strong><big>.</big></strong> <a href=\"modules.php?name=Defaced_Sites\">Defaced Sites</a><br>
<strong><big>.</big></strong> <a href=\"modules.php?name=Syndication\">News Syndication</a><br>
<strong><big>.</big></strong> <a href=\"modules.php?name=Newsletter\">Security Newsletter</a><br>
<strong><big>.</big></strong> <a href=\"modules.php?name=Encyclopedia\">Encyclopedia</a><br>
<strong><big>.</big></strong> <a href=\"modules.php?name=Web_Links\">Links Directory</a><br>
<strong><big>.</big></strong> <a href=\"modules.php?name=Downloads\">Downloads</a><br>
<strong><big>.</big></strong> <a href=\"modules.php?name=My_Uploads\">Uploads</a><br>
<strong><big>.</big></strong> <a href=\"modules.php?name=AvantGo\">PDA Channel</a><br>
<strong><big>.</big></strong> <a href=\"modules.php?name=Top\">Top Articles</a><br>
<br>
<strong>E-Shop</strong><br>
<strong><big>.</big></strong> <a href=\"modules.php?name=Amazon\">Book Shop</a><br>
<strong><big>.</big></strong> <a href=\"modules.php?name=Shopping_Cart\">Frame4 E-Shop</a><br>
<strong><big>.</big></strong> <a href=\"http://www.cafeshops.com/cp/store.aspx?s=frame4\" target=\"_blank\">Frame4 Merchandise</a><br>
<br>
<strong>Company Info</strong><br>
<strong><big>.</big></strong> <a href=\"modules.php?name=About_Us\">About Us</a><br>
<strong><big>.</big></strong> <a href=\"modules.php?name=Contact\">Contact</a><br>
<strong><big>.</big></strong> <a href=\"modules.php?name=Partner_Program\">Partner Program</a><br>
<strong><big>.</big></strong> <a href=\"modules.php?name=Submit_News\">Submit News</a><br>
<strong><big>.</big></strong> <a href=\"modules.php?name=Recommend_Us\">Recommend Us</a><br>
<strong><big>.</big></strong> <a href=\"modules.php?name=Feedback\">Feedback</a><br>
<strong><big>.</big></strong> <a href=\"modules.php?name=FAQ\">FAQ</a><br>
</noscript>
</td>
</TR>
</TABLE></CENTER>";

//STUFF REMOVED


Where is says

Code:
<SCRIPT language='JavaScript' src='$PATH_TO/menu_on.js' type='text/javascript'></SCRIPT>


I have menu_on.js for one, and menu_off.js for the other, so that is OK.

Anthony


Poster: Maz
Dated: Monday October 13 2003 - 17:12:14 BST

One thought... if you are placing the menu in a table - relative, then you can place the script line for the data in the table. Then the relative top and left is to the table.

maz


Poster: bzeitner
Dated: Tuesday October 14 2003 - 20:33:22 BST

Ok, here is a problem:

The menus in menu_on.js and menu_off.js have to have different names.


Poster: anthonyaykut
Dated: Tuesday October 14 2003 - 20:38:18 BST

Oh OK ... Just the "Main Menu" needs to be different or all of them?? I have like Products in menu_on as a submenu, and also have Products in menu_off...


Poster: Maz
Dated: Tuesday October 14 2003 - 21:02:13 BST

Different Style names for each menu, if your submenus have another style then each menu has its own submenu style also.

maz


Poster: bzeitner
Dated: Tuesday October 14 2003 - 21:18:32 BST

Quote:
Different Style names for each menu, if your submenus have another style then each menu has its own submenu style also.


No, you can have the same style names, just don't define them more than once. (unless of course, you want a different style on a menu)

Quote:
Oh OK ... Just the "Main Menu" needs to be different or all of them?? I have like Products in menu_on as a submenu, and also have Products in menu_off...

Each menu must have a different name. If it's defined or called more than once, you'll have issues.


Poster: anthonyaykut
Dated: Tuesday October 14 2003 - 22:04:21 BST

Erm, can you please check these for me... it still doesn't show the second menu... maybe if at least these look OK, I can look for the problem somehere else...

http://www.frame4.com/exchange/menu_on.txt
http://www.frame4.com/exchange/menu_off.txt

Thanks
Anthony


Poster: Maz
Dated: Tuesday October 14 2003 - 22:53:04 BST

Normally the scripts for milonic source files are placed just under the body tag, then you can place the script for data file in the table.

It appears you are using the exact same menu, only its called differently probably depending whether logged in or not, maybe you can use the same menu but the on off switch part is called before the menu loads, like a javascript or something.

Let us know if that's what you are doing, then perhaps someone will know about this.

Regards
maz


Poster: bzeitner
Dated: Tuesday October 14 2003 - 23:13:26 BST

They seem to check out... I compared the two and didn't notice anything wrong.. I then downloaded and used on a test page and they both displayed perfectly (Win2000 IE6).

On the test page, I called each menu from a separate <TD> as follows:
Code:
<table>
  <tr>
    <td><script language=JavaScript src="/menu_off.txt" type=text/javascript></script></td>
    <td><script language=JavaScript src="/menu_off.txt" type=text/javascript></script></td>
  </tr>
</table>


Poster: John
Dated: Tuesday October 14 2003 - 23:14:53 BST

maz wrote:
Normally the scripts for milonic source files are placed just under the body tag, then you can place the script for data file in the table.

Maz is correct here. However, I have some additional questions...

1. Why <table> data before the <body>?

2. Where is the call to menu_off?

3. Asked this before but didn't get an answer. Where exactly is the second menu supposed to be on the page? You mentioned a blank spot some time ago, but I don't see that.

There are some other general HTML problems, but not, I think, the cause of your troubles (<table> missing </td> and </tr>, </center> out of place, missing </font>, etc.).


Poster: bzeitner
Dated: Tuesday October 14 2003 - 23:27:06 BST

Quote:
There are some other general HTML problems, but not, I think, the cause of your troubles (<table> missing </td> and </tr>, </center> out of place, missing </font>, etc.).

On the contrary, I do believe this is where the problem lies. Especially because I can get both menus to work simply by using the same files in a properly formatted HTML file.

Try placing the calls to the milonic_src.js and the dom and ns in the <HEAD> tag of the file, while placing the calls to the data files where you want them to appear.


Poster: John
Dated: Tuesday October 14 2003 - 23:35:40 BST

Interesting, because I pulled the code down, fixed the errors, and could not get the menus to appear. :?


Poster: bzeitner
Dated: Wednesday October 15 2003 - 16:55:55 BST

Quote:
Interesting, because I pulled the code down, fixed the errors, and could not get the menus to appear.


Did you pull down the following two files?

Quote:
Erm, can you please check these for me... it still doesn't show the second menu... maybe if at least these look OK, I can look for the problem somehere else...

http://www.frame4.com/exchange/menu_on.txt
http://www.frame4.com/exchange/menu_off.txt

Thanks
Anthony


Those are the ones I tried, not the code that he pasted in one of the posts above. These two files seem to be good as far as syntax goes, and these two are the ones that worked on my test system.


Poster: John
Dated: Wednesday October 15 2003 - 16:59:22 BST

Yes, I did.