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

With URL Params - no highlighting in menu


Poster: jdsturgill
Dated: Thursday October 2 2003 - 17:41:16 BST

I'm brand new to Milonic so this may be a stupid question.

When I go to a particular page that is in the menu - the menu highlights to let people know what page they are on.

That's groovy.

However, if I go to that same page with a URL parameter - the menu does not highlight.

Question: Is it possible to tell the menu system to ignore the URL parameters and highlight the menu item regardless of the existence or value of the URL parameters?


Poster: John
Dated: Thursday October 2 2003 - 17:49:08 BST

What are you defining as 'a URL parameter'? To me that can mean many things.

Always best to post a URL, as requested, so we can see the problem and look at your code at the same time.


Poster: bzeitner
Dated: Thursday October 2 2003 - 18:28:13 BST

I take it he means the ?item=value portion of a URL, ie <a href="/dir1/page1.asp?item=value">link</a>


Poster: jdsturgill
Dated: Thursday October 2 2003 - 19:56:33 BST

These URLs are internal - so you will not be able to see the page - but here's the skinnny.

With the following URL - the menu item for Shipping is highlighted.
http://webdevnew/shoppingCart/admin/shipping.cfm

With the following URL - the menu item for Shipping is not highlighted
http://webdevnew/shoppingCart/admin/shi ... pping_id=2


Poster: Hergio
Dated: Thursday October 2 2003 - 22:05:30 BST

If webdevnew is the root of your site, try

/shoppingCart/admin/shipping.cfm

/shoppingCart/admin/shipping.cfm?shipping_id=2

as your urls. The forward slash at the beginning tells it to look in your root and start from there.


Poster: jdsturgill
Dated: Friday October 3 2003 - 13:14:40 BST

I'm may be slightly confused.

Are you suggesting that I add 2 menu items for shipping? One with and one without the URL Parameter?

I only want to have "Shipping Methods" to show up once in the Menu. However, this page will often be called with a URL Param to specify a particular shipping method. Ideally, I'd like Shipping Methods Navigation to highlight with or without a URL Parameter.


Poster: Hergio
Dated: Saturday October 4 2003 - 20:46:34 BST

No no no, I meant you have this as a menu item url...

http://webdevnew/shoppingCart/admin/shipping.cfm

change it this to see if it works...

/shoppingCart/admin/shipping.cfm

And then you can add the querystring to it to see if it works. Just remove the root name, thats all I was sayin.


Poster: halcyon
Dated: Wednesday October 8 2003 - 21:47:46 BST

I am having the same problem. When my url is:

/salesweb/viewFlexReferencesQuery.do
it matches it no problem and highlights it accordingly

however when I modify my query and it looks like
/salesweb/viewFlexReferencesQuery.do?sort=name&order=ASC
it is no longer highlighting it.

Code:
with(milonic=new menuname("References")){
   left="0";
   itemwidth="133";
   style=menuStyle;
   alwaysvisible="1";
   orientation="vertical";
   position="relative";
aI("text=New Query;url=/salesweb/showFlexReferencesQuery.do;");
aI("text=View References;url=/salesweb/viewFlexReferencesQuery.do;");
aI("text=Add Reference;url=/salesweb/addNewFlexReference.do;");
}


Any ideas?


Poster: bzeitner
Dated: Tuesday October 14 2003 - 20:10:47 BST

This is definitely a feature that needs to be implemented or, if implemented, a bug that needs to be fixed.

I use querystring's extensively- It helps consolidate code and provides an easier to manage interface. But the menu will not highlight the current page if the URL doesn't EXACTLY match what's in the menu.

Could the menu be setup to ignore the querystring (the ? and everything after it)?


Poster: John
Dated: Tuesday October 14 2003 - 20:58:39 BST

We had a problem a few weeks ago where an & in the URL was dropping the rest of the query. I know, not quite the same as here, but the fix was to use the entity instead of the actual character. In this case that would be %63.

Left field stab probably, but what the heck...


Poster: bzeitner
Dated: Tuesday October 14 2003 - 21:34:34 BST

I was following that topic, and it was noted. But this is a separate issue, and besides, I've already tried URL encoding ;)

The issue is that the menu, when it compares URLs to determine whether or not the currently viewed page is in the menu, doesn't take into account for the added info from a querystring. It doesn't know that index.asp?item=value (current page) is essentially the same as index.asp (menu item) unless the menu item is set to exactly index.asp?item=value.

Perhaps it could be added that the menu evaluate the current page's url, and if nothing in the menu matches it, and there is a querystring, then it remove the querystring and then evaluate if anything matches. Then, the menu could continue on it's merry way.

Am I making sense?


Poster: John
Dated: Tuesday October 14 2003 - 21:38:19 BST

bzeitner wrote:
Am I making sense?

Yep, except the final on this will have to come from Andy.


Poster: Hergio
Dated: Wednesday October 15 2003 - 2:52:16 BST

From what I THOUGHT the menu did, was use a javascript function known as MATCH. What match does is takes a string and searches for an instance of it in another string, anywhere in it. So if you have two menu items, one with URL = page.asp?var1=item and another with URL = page.asp..... if you go to page.asp, both should be highlighted, but if you go to the one with the querystring, only one SHOULD be highlighted (the one with the querystring). But this sounds likes it flubbing on the latter case. Andy, any insight?


Poster: halcyon
Dated: Wednesday October 22 2003 - 19:59:07 BST

Any update on this bug? Still exists with latest RC... please fix!!


Poster: John
Dated: Wednesday October 22 2003 - 21:19:00 BST

Patience. Lots going on right now, and Andy is working on things as fast as he can. Expect to see a darn-near-final-if-not-final in the next few days.


Poster: Andy
Dated: Friday October 24 2003 - 13:40:59 BST

What you are seeing is actually by design.

If you had several files all with query_strings and you highlighted them based on just the file name, they would all show up.

I can't see this being useful though. We might be able to add a flag or something, would this help?

Cheers
Andy


Poster: halcyon
Dated: Friday October 24 2003 - 20:01:02 BST

Thanks for the reply Andy, let me make it a little more clear what the current behavior is and what the desired behavior is.

URL Current Desired
/viewFlexReferencesQuery.do highlighted highlighted
/viewFlexReferencesQuery.do?sort=name not-highlighted highlighted

Make sense? If that is the intended behavior if you could make an option to match only the file name and ignore url parameters that would be great too.

Thanks,
David


Poster: halcyon
Dated: Friday October 24 2003 - 20:03:55 BST

In fact I'll give you the example of where this is in use at on our site. There is a menu item for "View Query" which is a query on some database stuff. Well after the query is loaded the user can click on the table headers to sort that information which will reload that file with url parameters. However they are still Viewing a Query, and we don't have seperate menu items to sort the data because that depends on how many columns are returned etc, so we still want the 'View Query' menu item lit up on the left side.

Thanks,
David


Poster: Maz
Dated: Friday October 24 2003 - 22:58:54 BST

I may be completely off on this, but might be worth mentioning.

I had a problem validating my site for xhtml, turned out php needed to change & to *& a m p ; so I had to make a htaccess for it. I changed all the page links to reflect this change. But the menu links didn't work when I changed them to *& a m p ; and I had to change them back to &. Now it validates and works perfectly.

Maybe there is a way of changing something, but the menu reads it different?

maz


Poster: Hergio
Dated: Monday October 27 2003 - 17:38:44 GMT

I think a flag or variable set at the top of the menu_data file or maybe even inside of the style (so its a per menu type of thing?) woulod be good. That way you can have alittle bit more granular control over what gets highlighted and what doesn't. I see David's point, in sites where there is alot of data (like intranets) sorting is a very common occurance and queryString variables are common and it'd be nice if they didn't interfer with the nice features presented by the menu.

Don't know if/when it would get in there, but since there are a couple other important things still to get done, might have to wait a short while, but Andy always comes through for his customers.


Poster: Andy
Dated: Monday October 27 2003 - 19:11:02 GMT

Can you give me some samples - even better build a menu_data file with the links you want.

This way, it saves me the job and you also get the links correct and how you want them. Tell me exactly how you want them to work and I'll get it done.

I assure you I'm not being lazy (well, possibly) I've just got so much other stuff to do it will help me out a lot.

Cheers
Andy


Poster: lv0031
Dated: Sunday June 13 2004 - 13:07:54 BST

Same problem here. But I found a (temporary) solution.

URL that does work (example)
- /Shopping/products.asp

URL that does NOT work (example)
- /Shopping/products.asp?ID=123

URL that does work (example)
- /Shopping/products.asp?ID=123&FILE=products.asp

The item "FILE" can changed with anything you want.

Mayby it helps for now. I personally think the source needs to by modified by the developer. By the way, Milonic Menu is a great tool.


Poster: Andy
Dated: Monday June 14 2004 - 9:27:23 BST

Hi lv0031,

Have you tried the very latest version (v5.22)?

Just tried it here and it works fine, so it could be that you have a buggy version running.

Cheers
Andy