Keeping highlight when subpage isn't 'in' menu [SOLVED]

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
Post Reply
imattjc
Beginner
Beginner
Posts: 9
Joined: Tue Oct 17, 2006 4:20 pm

Keeping highlight when subpage isn't 'in' menu [SOLVED]

Post by imattjc »

I have this problem. I have 3rd and 4th level pages and we want to have the menu highlighted for them. But these are not listed in the menu itself, and it appears that the highlighting is not working. This can be seen at:
http://ip.integreat-dev.com/news/Press-Releases.php - this is the second level page and works correctly. News is Gray.

http://ip.integreat-dev.com/news/sample ... elease.php - this is the third level page and News is not Gray.

Here are how I am calling the menus:

Code: Select all

with(milonic=new menuname("MainMenu")){
alwaysvisible=1;
left=0;
orientation="horizontal";
style=menuStyle;
top=73;
aI("offfunction=on();onfunction=off();image=/img/sep2.gif;overimage=/img/sep.gif;padding=0;itemwidth=3;imagealign=center;type=header;");
aI("offfunction=on();onfunction=off();image=/img/learn.gif;overimage=/img/learn_hi.gif;showmenu=Learn;url=/know/");
aI("offfunction=on();onfunction=off();image=/img/understand.gif;overimage=/img/understand_hi.gif;showmenu=Understand;url=/understand/");
aI("offfunction=on();onfunction=off();image=/img/fix.gif;overimage=/img/fix_hi.gif;showmenu=Fix;url=/fix/;");
}
drawMenus();

Code: Select all

fixMozillaZIndex=true; //Fixes Z-Index problem  with Mozilla browsers but causes odd scrolling problem, toggle to see if it helps
_menuCloseDelay=100;
_menuOpenDelay=150;


with(menuStyle4=new mm_style()){
bordercolor="#CC9900";
borderstyle="solid";
borderwidth=4;
fontfamily="Arial, Verdana, Tahoma";
fontsize="75%";
fontstyle="normal";
headerbgcolor="#CC9900";
headercolor="#CC9900";
offbgcolor="#CC9900";
offcolor="#CC9900";
onbgcolor="#CC9900";
oncolor="#CC9900";
padding=5;
pagebgcolor="#CC9900";
pagecolor="#666666";
}

with(menuStyle3=new mm_style()){
bordercolor="#CC9900";
borderstyle="solid";
borderwidth=4;
fontfamily="Arial, Verdana, Tahoma";
fontsize="85%";
fontstyle="normal";
headerbgcolor="#CC9900";
headercolor="#000000";
offbgcolor="#CC9900";
offcolor="#FFFFFF";
onbgcolor="#CC9900";
oncolor="#666666";
padding=4;
pagebgcolor="#CC9900";
pagecolor="#666666";
separatorcolor="#CC9900";
separatorsize=1;
}

with(milonic=new menuname("About")){
style=menuStyle3;
left="offset=-3";
aI("offfunction=on();onfunction=off();text=MISSION STATEMENT;url=/about/Mission-Statement.php;");
aI("offfunction=on();onfunction=off();text=FAQs;url=/about/FAQs.php;");
aI("offfunction=on();onfunction=off();text=BOARD OF DIRECTORS;url=/about/Board-of-Directors.php;");
aI("offfunction=on();onfunction=off();text=STAFF DIRECTORY;url=/about/Staff-Directory.php;");
aI("offfunction=on();onfunction=off();text=OPPORTUNITIES;url=/about/Opportunities.php;");
aI("offfunction=on();onfunction=off();text=CONTACT US;url=/about/Contact-Us.php;");
}

with(milonic=new menuname("Donate")){
style=menuStyle3;
left="offset=-3";
aI("offfunction=on();onfunction=off();text=CAPITAL CAMPAIGN;url=/donate/Capital-Campaign.php;");
aI("offfunction=on();onfunction=off();text=DONATE;url=/donate/Donate.php;");
}

with(milonic=new menuname("News")){
style=menuStyle3;
left="offset=-3";
aI("offfunction=on();onfunction=off();text=IP BLOG;url=/news/Blog.php;");
aI("offfunction=on();onfunction=off();text=PRESS RELEASES;url=/news/Press-Releases.php;");
aI("offfunction=on();onfunction=off();text=OTHER LEGAL INFORMATION;url=/news/Other-Legal-Information.php;");
aI("offfunction=on();onfunction=off();text=FACT SHEETS;url=/news/Fact-Sheets.php;");
aI("offfunction=on();onfunction=off();text=NATIONAL VIEW;url=/news/National-View.php;");
}

drawMenus();
Any help would be greatly appreciated....
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Post by Ruth »

Hi,

You can set up page 'matching' using folders. This means that any page in a folder which has a pagematch assigned will highlight the menu even if it's not in the menu.

Using the page you put up, make your aI string for the news and information the following:

Code: Select all

aI("offfunction=on();onfunction=off();image=/img/news2.gif;overimage=/img/news2_hi.gif;showmenu=News;url=/news/;pageimage=/img/news2_hi.gif;pagematch=/news/");
This should mean that even if you click a link on the main news page, if the page is in that news folder the menu should continue to match, actually any page that is in the news folder should keep the match.

Ruth
imattjc
Beginner
Beginner
Posts: 9
Joined: Tue Oct 17, 2006 4:20 pm

Thanks!!

Post by imattjc »

Thanks Ruth. Once again, you've saved me.
Post Reply