PageMatching not wanted

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
Post Reply
pscs
Advanced
Advanced
Posts: 15
Joined: Tue Sep 23, 2003 10:51 pm
Location: Huddersfield, UK

PageMatching not wanted

Post by pscs »

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 ;) )
Paul Smith
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Post by Ruth »

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
tepidarium
Mega User
Mega User
Posts: 169
Joined: Sun Oct 05, 2003 4:21 am

Post by tepidarium »

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...
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Post by Ruth »

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
User avatar
kevin3442
Milonic God
Milonic God
Posts: 2460
Joined: Sat Sep 07, 2002 12:09 am
Location: Lincoln, NE
Contact:

Re: PageMatching not wanted

Post by kevin3442 »

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: Select all

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
pscs
Advanced
Advanced
Posts: 15
Joined: Tue Sep 23, 2003 10:51 pm
Location: Huddersfield, UK

Re: PageMatching not wanted

Post by pscs »

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: Select all

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.
Paul Smith
User avatar
Andy
Milonic
Milonic
Posts: 3308
Joined: Sun May 19, 2002 8:23 pm
Location: Menu Developer
Contact:

Post by Andy »

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: Select all

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
User avatar
kevin3442
Milonic God
Milonic God
Posts: 2460
Joined: Sat Sep 07, 2002 12:09 am
Location: Lincoln, NE
Contact:

Re: PageMatching not wanted

Post by kevin3442 »

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
keeva_one
Advanced
Advanced
Posts: 15
Joined: Sun Apr 04, 2004 2:03 am
Location: Seattle, WA, USA
Contact:

Post by keeva_one »

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: Select all

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
keeva_one
Advanced
Advanced
Posts: 15
Joined: Sun Apr 04, 2004 2:03 am
Location: Seattle, WA, USA
Contact:

Post by keeva_one »

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: Select all

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: Select all

<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>
Post Reply