With URL Params - no highlighting in menu
-
- Beginner
- Posts: 3
- Joined: Thu Oct 02, 2003 5:35 pm
With URL Params - no highlighting in menu
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?
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?
-
- Beginner
- Posts: 3
- Joined: Thu Oct 02, 2003 5:35 pm
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
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
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.
/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.
Dave Hergert
Software Engineer
"Helping to make the menu better, one at a time."
Software Engineer
"Helping to make the menu better, one at a time."
-
- Beginner
- Posts: 3
- Joined: Thu Oct 02, 2003 5:35 pm
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.
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.
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.
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.
Dave Hergert
Software Engineer
"Helping to make the menu better, one at a time."
Software Engineer
"Helping to make the menu better, one at a time."
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.
Any ideas?
/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: Select all
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;");
}
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)?
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)?
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?
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?
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?
Dave Hergert
Software Engineer
"Helping to make the menu better, one at a time."
Software Engineer
"Helping to make the menu better, one at a time."
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
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
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
Thanks,
David
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
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
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.
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.
Dave Hergert
Software Engineer
"Helping to make the menu better, one at a time."
Software Engineer
"Helping to make the menu better, one at a time."