Erik
-
3/24/2009 1:53:20 PM
CMSListMenu and CssClass property
Hi everyone. Has anyone seen the standard CssClass property work for the CMSListMenu control? I would like to use the control to place a sub-menu on a page, and the <ul> it generates should have a class we defined in our main style sheet. The child <li> tags should not have any class. I tried a number of combinations, including the use of the CSSPrefixes property (with trailing spaces, which it does honor) and RenderCssClasses properties, but I could not get the class name I wanted to appear only on the top-level <ul>.
I was able to work around this by utilizing the CSSPrefix property, but we had to change our CSS class names to match the resulting classes generated with the prefix and built-in Kentico list menu classes. This is not as clean, but it is flexible enough if you don't mind changing your CSS.
If the CMSListMenu control is going to support the CssClass property, it should take its value and apply it to the top-level <ul>. Then, from there, we can style as we like, with nearly all the same flexibility. And this behavior is what is expected from a custom server control anyway.
Erik Bertrand Amplify Studios Manchester, NH USA
|