Download & Extend

Create option to add classes to the menu item <li> element

Project:Menu Views
Version:7.x-2.x-dev
Component:User interface
Category:feature request
Priority:normal
Assigned:Mark Carver
Status:closed (fixed)

Issue Summary

From: #1817622-5: Upgrading from 1 to 2 destroyed existing menu items

... we need the ability to add classes to the <li/> element? I've have been thinking about wrapping the entire view (and view title if it exists) with something like: <div class="menu-view"></div>. Perhaps, however, classes should just be added to the <li/> element instead. I agree that some type of this functionality is definitely needed.

@todo: Create a separate issue once this one is finished to provide support for Superfish. Given the lack of theme hooks in Superfish module, this feature might be difficult to implement.

Comments

#1

Could this feature just be unavailable to Superfish at first?

#2

I second that. Having a module be dependent on another is madness!

Would it be possible to add a menu class to menu_views_menu_link that identifies its menu items as a menu_views item? Given that the biggest use case for this module is creating mega menus, having its menu item identify beyond the default leaf will be very helpful.

Thanks,

Uzi

#3

Dependent?? Where do y'all get that from? The @todo is merely a note for something "to-do". Granted how I worded it probably doesn't point the right picture, but these issue queues are a place for us to keep our notes. When I start actually coding this feature, I just didn't want to forget about support for Superfish. In all reality, a supplemental issue will probably be created just for Superfish additions for this feature.

#4

A simple patch to add 'menu-view' class to menu views <li> tags. You probably want to add more precise classes based on view id or name but that's a start and something I needed in my project.

AttachmentSizeStatusTest resultOperations
add-classes-to-menu-views-item-li-element-1824588-4.patch554 bytesIgnored: Check issue status.NoneNone

#5

Status:active» fixed

Added in the release of 7.x-2.1 (http://drupal.org/node/1909888)

#6

Status:fixed» closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

nobody click here