Displaying 2 Menus on One Page
-
- Beginner
- Posts: 5
- Joined: Sun Oct 12, 2003 6:48 pm
Displaying 2 Menus on One Page
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/
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/
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
I'll have more time to look over it later.
maz
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
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
-
- Beginner
- Posts: 5
- Joined: Sun Oct 12, 2003 6:48 pm
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
Anthony
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

Anthony
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.
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.
-
- Beginner
- Posts: 5
- Joined: Sun Oct 12, 2003 6:48 pm
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):
My menu_on.js file (shortened):
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...
Where is says
I have menu_on.js for one, and menu_off.js for the other, so that is OK.
Anthony
My menu_off.js file (shortened):
Code: Select all
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();
Code: Select all
_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();
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: Select all
//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
Code: Select all
<SCRIPT language='JavaScript' src='$PATH_TO/menu_on.js' type='text/javascript'></SCRIPT>
Anthony
-
- Beginner
- Posts: 5
- Joined: Sun Oct 12, 2003 6:48 pm
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)Different Style names for each menu, if your submenus have another style then each menu has its own submenu style also.
Each menu must have a different name. If it's defined or called more than once, you'll have issues.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...
-
- Beginner
- Posts: 5
- Joined: Sun Oct 12, 2003 6:48 pm
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
http://www.frame4.com/exchange/menu_on.txt
http://www.frame4.com/exchange/menu_off.txt
Thanks
Anthony
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
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
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:
On the test page, I called each menu from a separate <TD> as follows:
Code: Select all
<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>
Maz is correct here. However, I have some additional questions...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.
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.).
John
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.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.).
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.
Did you pull down the following two files?Interesting, because I pulled the code down, fixed the errors, and could not get the menus to appear.
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.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