ASPX templates
Version 4.x > ASPX templates > CMSListMenu and CssClass property View modes: 
User avatar
Member
Member
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

User avatar
Kentico Developer
Kentico Developer
kentico_helenag - 3/31/2009 5:51:57 AM
   
RE:CMSListMenu and CssClass property
Hi Erik,

if you would like to understand the possibilities of CMSListMenu styling please see here:

http://devnet.kentico.com/docs/controls/cmslistmenu.htm
http://devnet.kentico.com/docs/controls/using_the_cssprefix_property_for_design_of_sub_menus.htm

I hope it could be helpful for you.

Best regards,
Helena Grulichova