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

Menu Highlight from link - ASP {SOLVED}


Poster: drumbo
Dated: Tuesday December 6 2005 - 18:22:06 GMT

Another question if I may:

I have a ASP page which lists pictures I have taken on my site. However if there are a lot of pages, I use a paging function.

i.e. Page one has pic 1-12, page 2 has pic 13-24

When I use the menu to go to pictures page, then the highlight shows which menu I am in (i.e. pictures, cat1, subcat2) and pics 1-12 are shown. I can then click on a link (external to the menu) to go to page 2 (i.e. pics 13-24). When this happens the highlights on the menu are gone.

Is there anyway I can get the highlights to remain through the paging operation?

I have tried the mmItemActivateByNumber function but can only get the 3rd level of my menu to show (not its parents)

If I try mmItemActivateByText, then it won't find the menu items beyond level 1.

Thanks in advance


Poster: Ruth
Dated: Friday December 9 2005 - 20:51:58 GMT

Hi,

Can you give us a link, please so I can see the set up and layout?

I can make suggestions but having the real page might make them more pertinent.

For example you could use pagematch= and set it for a folder. That way, when you were on any page in that folder the menu should highlight for that folder since the pagematch is set to the folder instead of a page.

Ruth


Poster: drumbo
Dated: Monday December 12 2005 - 13:51:06 GMT

Hi Ruth,

you can take a look at test.drumanda.net
username is test and password is test.

If you go through the following menu
Pictures, South Africa (104pics), Kruger National Park(31pics)

when you arrive at the pics, you can see that the menu is highlighted correctly, if you then page through the pics (using the right arrow), on the second and subsequent pages, you will notice that the menu is no longer highlighted.

This is what I would like to fix.

There are no pictures (as it is a test site)!

Thanks for the help


Poster: Ruth
Dated: Monday December 12 2005 - 20:07:18 GMT

Hi,

I'm sorry I am not going to be able to help on this. I know nothing about ASP and how anything works with that. The reason your highlighter module is not working is that you are not getting there by anything in the menu once you click on one of the images or on the arrows.

The only way I know to do matching like that is to use pagematch and I'm not sure given all the different categories how you'd make it work back to the word Pictures. I know you can use folders as a pagematch so that once you arrive, even if you click a link on the page, if it goes to aother page in the folder the menu will remain highlighted. For example:

Code:
aI("text=News Events;url=/aboutus/newsevents/index.shtml;pagematch=/aboutus/newsevents/;");


On that index page you have some text links to other news items, these pages are in the /aboutus/newsevents folder and even though you click for them from the link, the page highlighting will remain because the pagematch is set to that folder.

Also, in the Menu Quick Reference Guides, under Item Properties there's an example of pagematch which uses things like cat=10, while the pages are different because of their query strings.

The only other thing I can think to do is put that center part with the images on a page in a iframe which means the full page doesn't reload, only the iframe page when you click the link and so the menu will always remain highlighted. I'm sorry I couldn't be more help.

Nice site. I like the way you have it set up. By the way, did you know that Milonic has a clock module It's down about 3 from the bottom, and there's an example of its use here under the demos page. The clock is toward the bottom, the other things are demos for functions that have been written in the forum and other module demos.

Hope this helps.

Ruth


Poster: drumbo
Dated: Tuesday December 13 2005 - 10:36:12 GMT

Ruth,

2 thanks - 1 for your help and a second (big one) for the complement. One of the first I have received :)

I have tried implementing your suggestion for the page match. For example I have included the following

aI("status=The Cats;text=The Cats(12 pics);url=/ASPScripts/pictures.asp?subcat=The Cats&cat=Ireland&PGDesc=Our Pictures&CC=20&SCC=1035;pagematch=/ASPScripts/pictures.asp?<b>CC=20&SCC=1035</b>;");}

I have added category numbers and sub category numbers now to all so as to be able to identify each page.

The above doesn't work and I guess because the paging function has no link back to the menu. So when I click on the right arrow, it does not invoke the pagematch function in the menu.

So, can I put on my right button something along the lines of "<onclick=javascript:
pagematch=/ASPScripts/pictures.asp?subcat=The Cats&cat=Ireland&PGDesc=Our Pictures&CC=20&SCC=1035;>"?

The other way I thought might work (but can't work out the jscript for it) is to to populate the CC and SCC with the internal ID's that Milonic use to create the menu and then use the <body onload=mmItemActivateByNumber(request("CC")) mmItemActivateByNumber(request("SCC"))>

Thanks for the heads up about the clock - I took a quick scan and it looks as though it shows the client clock, where as mine shows the server time (rather than the client time).

Again I have to say thanks for the help - it really is appreciated.


Poster: Ruth
Dated: Wednesday December 14 2005 - 0:02:47 GMT

Hi,

This is way beyond my skill level. As to the pagematch. Yes, you would have to get there through the menu, unless you set it up to match the folder not a page.

Have you thought about using the menu for your select form? There is a demo for that with two different types of setups, I think the one you'd want if this would work would be the mm_setSelected

http://support.milonic.com/demos/select_box/index.htm

I don't know if this would be useable or not, if there were a way to get it to work, then it should keep the highlighting, but don't quote me!

There is also a post about a 'tweak' which I think is really a function, using the menu inside a form to trigger submenus to open from a textarea, I think. Again, I have no idea if any of this would be helpful.... just giving you the info

http://www.milonic.com/forum/viewtopic.php?p=32822 you'll need to click the link Andy gave at the end of this post to get to the 'fix'

Ruth


Poster: drumbo
Dated: Wednesday December 14 2005 - 9:24:01 GMT

Thanks again Ruth for the ideas and links.

One final question : Do you know a way that I can determine the internal ID's associated with each menu item?


Poster: Shap5202
Dated: Wednesday December 14 2005 - 13:42:44 GMT

you can use _itemRef to get a reference to the menu item ID. Should be able to pass that to a javascript method or something in your menu url?


Poster: drumbo
Dated: Wednesday December 14 2005 - 14:02:47 GMT

Shap5202 wrote:
you can use _itemRef to get a reference to the menu item ID. Should be able to pass that to a javascript method or something in your menu url?


Thanks Shap5202,

I have never been able to get the _itemRef to work (other than getting -1 the whole time)

I was hoping that I could look in _m or _mi to find the ID, but could not figure out which was the ID's


Poster: drumbo
Dated: Wednesday December 14 2005 - 17:01:29 GMT

Ruth and Shap5202,

I managed to get it to work, so thanks both for your help!


Poster: Ruth
Dated: Wednesday December 14 2005 - 17:18:00 GMT

Hi,

Glad you got it to work! As to item reference, I have no clue, however there are two demos, one for a highlighting breadcrumb, and one for a text breadcrumb. I think they do something with item reference.

http://support.milonic.com/demos/breadcrumb/index.htm

http://support.milonic.com/demos/pass_i ... /index.htm

By the way, how did you get it to work?

Ruth


Poster: drumbo
Dated: Thursday December 15 2005 - 14:33:21 GMT

Hi Ruth,

I used the following script that i modified at the top of my data file
function mm_openUrl(url)
{
menu = _itemRef;
pmenu = getParentItemByItem(_itemRef);
hmenu = getParentItemByItem(getParentItemByItem(_itemRef));
if (hmenu==-1) {hmenu=""}
else {hmenu = "&hmenu=" + hmenu}
if (pmenu==undefined) {pmenu=""}
else {pmenu = "&pmenu=" + pmenu}
url+="&menu="+menu+pmenu+hmenu;
window.location.href = url;
}


call the function for each URL in the menu, and then use

<body onload="mmItemActivateByNumber(<%=request.querystring("menu")%>);<%=pmenu%><%=hmenu%>">

There is some ASP scripts on each page to check if pmenu and hmenu have values and if not, then they are set to nothing so that I don't get javascript errors for the onload part