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:28

PageMatching not wanted


Poster: pscs
Dated: Friday May 14 2004 - 10:03:23 BST

Is it possible to have a 'don't match page' option for a menu item?

I have a menu where two menu options link to the same page (there are two logical ways to navigate to the same information). When the user is on that page I'd like only the 'main' way to be highlighted, not both ways.

I originally thought PageMatch might work because I could put a dummy match value in to make it not match, but it looks like it matches on either PageMatch OR the url value, which isn't what I want :(

(I could hack the code, but I'd obviously rather not ;) )


Poster: Ruth
Dated: Friday May 14 2004 - 21:15:39 BST

Someone with more technical knowledge will have to address this, but just on the offchance did you try putting the pagematch=none; in the item? I have no clue if that would work. It may be that the global value will override the item value.

Ruth


Poster: tepidarium
Dated: Friday May 14 2004 - 21:16:08 BST

I know what you are referring to it happens on one page of our site as well. I would preferebly like to only pagematch one path - but can't get it to do that...


Poster: Ruth
Dated: Saturday May 15 2004 - 2:34:59 BST

After checking I see you can put pagematch in an item, so I would think you could do it for the item you don't want to match making the color the offbgcolor of the menu. Then when anyone was on the page it would just be the normal offbgcolor.

Ruth

Re: PageMatching not wanted


Poster: kevin3442
Dated: Saturday May 15 2004 - 2:45:36 BST

pscs wrote:
Is it possible to have a 'don't match page' option for a menu item?... I originally thought PageMatch might work...

From your description, I'm assuming that you used pagematch in the menu item's aI() string, not in the menu's style... right? But no cigar.... You could take the opposite route: disable the pagematching colors in the item where you don;t want the colors to change. I.e., In the menu item that you do not want to match, try:
Code:
aI("text=ItemText;url=whatever.html;pagecolor=null;pagebgcolor=null;");

Setting the properties to null in the item should override the settings in the menu style and will essentially disable page matching for that particular item.

Hope that helps,

Kevin

Re: PageMatching not wanted


Poster: pscs
Dated: Monday May 17 2004 - 10:01:43 BST

Quote:
no cigar.... You could take the opposite route: disable the pagematching colors in the item where you don;t want the colors to change. I.e., In the menu item that you do not want to match, try:
Code:
aI("text=ItemText;url=whatever.html;pagecolor=null;pagebgcolor=null;");

Setting the properties to null in the item should override the settings in the menu style and will essentially disable page matching for that particular item.


Unfortunately not, I'd already tried that...

That quite happily "hides" the page matching for the menu item, but not for the menu item's parents, so the main menu shows a highlight on two places, but on one of them if you go into the submenu the highlight isn't there, so it's even more confusing because there is a 'mystery' highlight... :?

The way I've worked around it for now is to put a meaningless '?val=1' on the end of the URL on one of the links. It does nothing, but makes the menu system think they're different links.


Poster: Andy
Dated: Monday May 17 2004 - 11:20:36 BST

Hi,

We could add a property called nomatch but I think te following will be just as good. It sets up the colors as variables and if the URL matches the specified text it will null the variables.

Code:
menupagebgcolor = "#ECF4F9";
menupagecolor = "#000000";

if(location.pathname=="/index.html")
{
     menupagebgcolor = null;
     menupagecolor = null;
}
with(vertStyle=new mm_style()){
  onbgcolor = "#4F8EB6";
  oncolor = "#ffffff";
  offbgcolor = "#ffffff";
  offcolor = "#000000";
  fontfamily = "arial, verdana, tahoma";
  pagebgcolor = menupagebgcolor;
  pagecolor = menupagecolor;
}


Hope this helps
Andy

Re: PageMatching not wanted


Poster: kevin3442
Dated: Monday May 17 2004 - 15:59:07 BST

pscs wrote:
...Unfortunately not, I'd already tried that... That quite happily "hides" the page matching for the menu item, but not for the menu item's parents...

Hmmmm.... You did ask
pscs wrote:
Is it possible to have a 'don't match page' option for a menu item?

So that's what I went for... how to affect a menu item. Sorry for the misinterpretation.

Kevin


Poster: keeva_one
Dated: Monday June 28 2004 - 20:08:27 BST

I have the same problem with page matching. Is the code below the only way to "turn off" page matching on a main menu item and/or sub menu item?

I could not get this code to work?

Please help,

- Kevin



Andy wrote:
Hi,

We could add a property called nomatch but I think te following will be just as good. It sets up the colors as variables and if the URL matches the specified text it will null the variables.

Code:
menupagebgcolor = "#ECF4F9";
menupagecolor = "#000000";

if(location.pathname=="/index.html")
{
     menupagebgcolor = null;
     menupagecolor = null;
}
with(vertStyle=new mm_style()){
  onbgcolor = "#4F8EB6";
  oncolor = "#ffffff";
  offbgcolor = "#ffffff";
  offcolor = "#000000";
  fontfamily = "arial, verdana, tahoma";
  pagebgcolor = menupagebgcolor;
  pagecolor = menupagecolor;
}


Hope this helps
Andy


Poster: keeva_one
Dated: Monday June 28 2004 - 20:28:44 BST

Whoops.. I just realized PAGEMATCH hasn't been working for me at all. Only pagecolor and pagebgcolor have been working.

What's the trick to use pagematch instead of match any URL? I've search pagematch and looked through all the threads and this thread seems most meaningful but I still can't get it to work?

thanks in advance,

- Kevin

here's my code:



Code:
with(menuStyle=new mm_style()){
onbgcolor="#F067A6";
offbgcolor="#000000";
oncolor="#FFFFFF";
offcolor="#FFFFFF";
separatorcolor="#000000";
separatorsize=30;
padding=6;
fontsize="11px";
fontweight="bold";
pagematch="#F067A6";
pagecolor="#F067A6";
pagebgcolor="#000000";
}

with(milonic=new menuname("Main Menu")){
style=menuStyle;
screenposition="center";
top=50;
alwaysvisible=1;
orientation="horizontal";
aI("text=home;url=/;");
aI("text=forum;showmenu=forum;pointer=default;pagematch=/forum/;");
aI("text=join;showmenu=join;pointer=default;pagematch=/join/;");
aI("text=about;showmenu=about;pointer=default;pagematch=/about/;");
}



with(milonic=new menuname("join")){
style=submenuStyle;
top="offset="+_mySubOffsetTop;
aI("text=join the mailing list;url=/join/?p=subscribe;pagematch=/join/?p=subscribe;");
aI("text=join the street team;url=/join/streetteam/;pagematch=/join/streetteam/;");
aI("text=unsubscribe from the mailing list;url=/join/unsubscribe.php;pagematch=;");
}


this is in the <head> (I sure hope I don't have to move it... :oops:
Code:
<script language=JavaScript src="/scripts_css/milonic_src.js" type=text/javascript></script>
<script   language="javascript" type="text/JavaScript">
//<![CDATA[
if(ns4)_d.write("<scr"+"ipt language=JavaScript src=/scripts_css/mmenuns4.js><\/scr"+"ipt>");      
  else _d.write("<scr"+"ipt language=JavaScript src=/scripts_css/mmenudom.js><\/scr"+"ipt>");
  //]]>
</script>
<script language=JavaScript src="/scripts_css/menu_data2.js" type=text/javascript></script>