Design and CSS styles
Version 7.x > Design and CSS styles > CMSListMenu and CSS Classes View modes: 
User avatar
Member
Member
joelbower-gmail - 2/19/2013 12:05:11 PM
   
CMSListMenu and CSS Classes
Hoping someone can point me in the right direction. I've added classes to my menu items via the CMS Desk > content > properties > navigation > menu design fields, which works fine. The second I select a page, however, my class is overwritten with 'CMSListMenuHighlightedLI'

Is there any way to keep the class i've specified and just append the highlighted class?

User avatar
Kentico Legend
Kentico Legend
Brenden Kehren - 2/19/2013 12:28:58 PM
   
RE:CMSListMenu and CSS Classes
I suggest creating or modifying your existing classes to utilize the classes auto generated by the CMSListMenu. Nice thing is you can specify a comma separated list of node prefixes. For instnace: first, second, third. Then you have a structure like so:

<ul class="firstCMSListMenuUL">
<li class="firstCMSListMenuLI">
menu option 1
</li>
<li class="firstCMSListMenuLI">
menu option 2 w/nested items
<ul class="secondCMSListMentUL">
<li class="secondCMSListMenuLI">
Nested item under menu option 2
</li>
</ul>
</li>
</ul>

You can easily create styles for it in your css.

Another option is to uncheck the box so it will not render the CSS classes dyamically for you.

User avatar
Member
Member
joelbower-gmail - 2/19/2013 4:08:42 PM
   
RE:CMSListMenu and CSS Classes
I needed identifiers on each of the menu items to apply specific icons to them, so i've gotten around the issue by using RenderItemID.

Just seems strange to give a way to manipulate class names, but then replace it outright if selected. Surely a better way would be to append the selected classname to the item itself, no?

Anyway, argument for another time!

User avatar
Kentico Legend
Kentico Legend
Brenden Kehren - 2/19/2013 4:12:32 PM
   
RE:CMSListMenu and CSS Classes
What is the structure (HTML) of your menu? I might have a suggestion based on what your answer is. Secondly, I believe if you're using the CMSListMenu, you have the most control over CSS by taking advantage of the built in classes the menu provides.

User avatar
Kentico Support
Kentico Support
kentico_janh - 2/19/2013 10:52:51 PM
   
RE:CMSListMenu and CSS Classes
Hello,

In the location you have mentioned (Properties -> Navigation) there is a field for the highlighted css class as well, so you can specify it as you wish:

Menu item design - highlighted -> Menu item CSS class: my_highlighted

Best regards,
Jan Hermann

User avatar
Member
Member
joelbower-gmail - 2/20/2013 11:24:58 AM
   
RE:CMSListMenu and CSS Classes
Weird, i set that up the other day and for some reason it wasn't working! Now it is!!!

Thanks Jan!