1

I've seen lots of answers, but they only allow you to add classes to all Menu Blocks, or to specific Menus.

I have multiple menu blocks with the same menu behind them (1st level block, 2nd level block, etc.)

I need each menu block to have a unique class based upon the name of the Menu Block. Is this possible?

0

Unless your theme changes the usual behavior then each of your menu blocks will have its own unique ID so you can use CSS like this (note the ID/class I used here might not be the ones you have to use, they're just an example):

#block-menu-block-2 ul.menu

This way you don't have to worry about overriding the markup of the menu to add classes in.

  • I was hoping to have a way to use the UL, since I stripped the wrapper div already (I hate Drupal's DOM bloat). – Joren May 20 '15 at 17:47
  • There is a way to do that, I just put this as an alternative. – rooby May 20 '15 at 23:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.