Hello,

A requirement for a current site I'm working on is a striped menu block as shown in the image below:
http://img191.imageshack.us/img191/2843/menuz.png

Initially, menus were single-level so all I did was created a striped background image twice the height of a menu item and had that as a background for the block.

However, it now needs to support three levels (as shown in the image) and the issue has got me stumped as the old solution is no longer acceptable. Drupal has no way of telling which menu item is on an odd or even row, so doing this via CSS alone won't work.

Is there PHP code I can edit to get Drupal to add odd/even classes to each menu item or any other way to fix this issue. I'm competent with PHP coding so if someone can at least give me an idea of where the code for rendering menus may be, I might be able to fix an issue.

Comments

dnewkerk’s picture

Have a look in the template.php of Framework theme for a snippet that adds even/odd classes to menu list items.

andregriffin’s picture

Yes, and specifically take a look at versions 2.2 and below of Framework. I had completely rewritten the menu formatting to support this styling.

See here: Framework 2.2 Demo - demo/demo

NRaf’s picture

Okay, I've finished my exams and have time to get back to this.

Thanks a ton for the Framework theme, it has what I need. One thing, what's the difference between 2.2 and the latest version when it comes to the menus?

Also, are you guys completely sure this is working right? I don't know if my CSS is wrong, but when I'm in an expanded menu, the class of the menu (odd or even) doesn't seem to follow up on the previous class. For example, in my example, the first item is, let's say even, and the second item is odd, and so on. The second item, however, is an expandable menu, and when I click into it, it ceases to be odd, but starts at even again.

Has anyone else experienced this issue?