G'Day Rusty and all users of cssfriendly adaptors!
Fistly, Russ, Love your work. Finally valid xhtml when using the menu adaptor!
However I ran into a few problem during our intergration into our CMS (using basic cssfriendly menu adaptors, with horizontal layout using web.sitemap and
xhtmlConformance
mode="Strict" in web.config)
The first small issue was the menu adaptor was rendering & instead of & within links even though I had & in the link in the sitemap, so we ended up with more xhtml validation errors than before! I fixed this by putting the ampersand special characters back
in...line 100 on standard adaptors/menuadaptor.vb
This workaround seems to work fine, and voila, no more w3c validation errors. Thats Gold, as we say Down Under!
My 2nd problem is a wierd one. Only in IE 6+, when the menu adaptor renders a leaf loop, only
the first "cell" or LI in the listing is wholey clickable, ie the background *and* the link are clickable.
The rest seem to have the same class call, but only the first <li> works as expected, the rest only
the link is clickable. Here is the rendered HTML sample from the browser's source code....
So in this example, Online Shop and A4 Letterheads "cells" or leaf LI's are clickable, but another test category is not....and any further lists rendered are also not clickable.
Can anyone shed some light on this, or has anyone seen this behaviour before, as its got me stumped? The "cells" are fully clickable in FireFox/Mozilla based browsers.....and I noticed in the cssfriendly examples the menus
work as expected in IE, and all cells are clickable, So perhaps Ive just stuffed something up....
Cheers in advance, and thanks again for all your hard work on this project, Russ.
Is this overkill? This just seems a bit safer to me but I'd like to hear your thoughts if you disagree.
Regarding the weird problem with clickability... hmmm, that's a tough one. I'd be interested in knowing if you were able to recreate the problem with some stripped down static HTML and embedded CSS styles (in the HEAD).
Hey, Drew. Thanks for posting the boiled down vesion. I can definitely see the problem you reported.
I took a look at the markup and the CSS. The first thing that struck me was that there didn't appear to be a conditional link over to IEMenus.css. Remember what the white paper says:
For menus to work properly in Internet Explorer your pages must explicitly and conditionally link to BrowserSpecificCSS\SampleAdaptersIE.css by putting markup like this in the <head> of your pages:
<!--[if lt IE 9]>
<link runat="server" rel="stylesheet" href="~/BrowserSpecificCSS/IEMenu.css" type="text/css">
<![endif]-->
It would help the analysis if you could add this extra style sheet and see if the problem goes away. I'll be happy to continue to hunt for the problem if this recommendation doesn't eliminate it. Thanks.
PS The kit puts this conditional link to IEMenu.css in its main.master file in the root folder. You site, however, may want to put this link to IEMenu.css elsewhere. It's only important that your page link to it somehow.
Coming waaaaaaaaay late to the party here, but I found this thread while re-looking for another one I had found before about fixing a problem I was having with ampersands in the
text of the menus. Even with & in the web.sitemap file, I was getting just & in the generated menus.
I ended up sticking this in at the beginning of BuildItem:
private void BuildItem(MenuItem item, HtmlTextWriter writer)
{
Menu menu = Control as Menu;
if ((menu != null) && (item != null) && (writer != null))
{ item.Text = Page.Server.HtmlEncode(item.Text);
Seems to have done what it needed to do. Would there be a better way to do this?
deeman
Member
45 Points
9 Posts
"cell" link IE wierdness in Menu List <li> with class AspNet-Menu-Leaf
May 26, 2006 05:32 AM|LINK
G'Day Rusty and all users of cssfriendly adaptors!
Fistly, Russ, Love your work. Finally valid xhtml when using the menu adaptor!
However I ran into a few problem during our intergration into our CMS (using basic cssfriendly menu adaptors, with horizontal layout using web.sitemap and xhtmlConformance mode="Strict" in web.config)
The first small issue was the menu adaptor was rendering & instead of & within links even though I had & in the link in the sitemap, so we ended up with more xhtml validation errors than before! I fixed this by putting the ampersand special characters back in...line 100 on standard adaptors/menuadaptor.vb
writer.WriteAttribute("href", Page.ResolveUrl(Replace(item.NavigateUrl, "&", "&")))
This workaround seems to work fine, and voila, no more w3c validation errors. Thats Gold, as we say Down Under!
My 2nd problem is a wierd one. Only in IE 6+, when the menu adaptor renders a leaf loop, only
the first "cell" or LI in the listing is wholey clickable, ie the background *and* the link are clickable.
The rest seem to have the same class call, but only the first <li> works as expected, the rest only
the link is clickable. Here is the rendered HTML sample from the browser's source code....
<li class="AspNet-Menu-WithChildren"> <a href="catalogue.aspx?" class="AspNet-Menu-Link" title="Catalogue"> Online Shop </a> <ul> <li class="AspNet-Menu-Leaf"> <a href="catalogue.aspx?action=view&cID=20" class="AspNet-Menu-Link"> A4 Letterhead Forms </a> </li> <li class="AspNet-Menu-Leaf"> <a href"catalogue.aspx?action=view&cID=33" class="AspNet-Menu-Link"> Another test category </a> </li> </ul> </li>So in this example, Online Shop and A4 Letterheads "cells" or leaf LI's are clickable, but another test category is not....and any further lists rendered are also not clickable.
Can anyone shed some light on this, or has anyone seen this behaviour before, as its got me stumped? The "cells" are fully clickable in FireFox/Mozilla based browsers.....and I noticed in the cssfriendly examples the menus
work as expected in IE, and all cells are clickable, So perhaps Ive just stuffed something up....
Cheers in advance, and thanks again for all your hard work on this project, Russ.
:Drewman
Russ Helfand
Contributor
3304 Points
744 Posts
Re: "cell" link IE wierdness in Menu List <li> with class AspNet-Menu-Leaf
May 26, 2006 04:19 PM|LINK
Nice to know that you're enjoying riding this adapter wave. It's groovy that people are "getting it."
Regarding the sin of not encoding the ampersand... I hang my head in shame. It's already fixed in the next (unreleased) rev. but slightly differently:
writer.WriteAttribute("href", Page.Server.HtmlEncode(Page.ResolveUrl(item.NavigateUrl)));
Is this overkill? This just seems a bit safer to me but I'd like to hear your thoughts if you disagree.
Regarding the weird problem with clickability... hmmm, that's a tough one. I'd be interested in knowing if you were able to recreate the problem with some stripped down static HTML and embedded CSS styles (in the HEAD).
Groovybits.com
deeman
Member
45 Points
9 Posts
Re: "cell" link IE wierdness in Menu List <li> with class AspNet-Menu-Leaf
May 29, 2006 01:06 AM|LINK
page.server.htmlencode - why didnt I think of that!!!!
Re the other problem, I'll rip out the rendered stuff, test and get back to you shortly...
Cheers for you help.
Drew
deeman
Member
45 Points
9 Posts
Re: "cell" link IE wierdness in Menu List <li> with class AspNet-Menu-Leaf
May 29, 2006 05:51 AM|LINK
Ok I've got a stripped out version of the menu happening, showing the same behaviour as I described earlier in this thread....
http://www.meztron.com/dev/test.htm
Russ, any chance you can have a quick look to see what I am doing wrong?
I'm also having a z-index issue with IE, which I will post in another topic...
Cheers in Advance
Drew
Russ Helfand
Contributor
3304 Points
744 Posts
Re: "cell" link IE wierdness in Menu List <li> with class AspNet-Menu-Leaf
May 29, 2006 01:32 PM|LINK
Hey, Drew. Thanks for posting the boiled down vesion. I can definitely see the problem you reported.
I took a look at the markup and the CSS. The first thing that struck me was that there didn't appear to be a conditional link over to IEMenus.css. Remember what the white paper says:
It would help the analysis if you could add this extra style sheet and see if the problem goes away. I'll be happy to continue to hunt for the problem if this recommendation doesn't eliminate it. Thanks.
PS The kit puts this conditional link to IEMenu.css in its main.master file in the root folder. You site, however, may want to put this link to IEMenu.css elsewhere. It's only important that your page link to it somehow.
Groovybits.com
deeman
Member
45 Points
9 Posts
Re: "cell" link IE wierdness in Menu List <li> with class AspNet-Menu-Leaf
May 30, 2006 02:27 AM|LINK
Hi Russ...
Thank you very much for taking the time to check out our problem. Your an absolute legend mate...
The additional style include we missed has made *all* the cells clickable now....so thats fantastic!
Still getting that overlaping z-index problem I posted previously in another post, but that is looking more and more like an IE bug...
Should I be posting that elsewhere?
Cheers again for all your help.
Drew
aezzell
Member
10 Points
8 Posts
Re: "cell" link IE wierdness in Menu List <li> with class AspNet-Menu-Leaf
Oct 08, 2008 10:33 PM|LINK
Coming waaaaaaaaay late to the party here, but I found this thread while re-looking for another one I had found before about fixing a problem I was having with ampersands in the text of the menus. Even with & in the web.sitemap file, I was getting just & in the generated menus.
I ended up sticking this in at the beginning of BuildItem:
private void BuildItem(MenuItem item, HtmlTextWriter writer)
{
Menu menu = Control as Menu;
if ((menu != null) && (item != null) && (writer != null))
{
item.Text = Page.Server.HtmlEncode(item.Text);
Seems to have done what it needed to do. Would there be a better way to do this?
Thanks!