Download & Extend

zebra coloring doesn't work with dhtml_menu

Project:Framework
Version:6.x-2.2
Component:CSS/HTML markup
Category:support request
Priority:normal
Assigned:Unassigned
Status:closed (won't fix)

Issue Summary

Hi,

When using dhtml_menu module the zebra coloring for menus doesn't work well.
This is because dhtml_menu preprocesses the menu not following the original items order.

The attached patch tries to improve the zebra coloring making it also a bit more robust.
Maybe the zebra coloring should be done at menu level rather than at menu_item level?

Please comment.

Regards,
Antonio

AttachmentSize
theme_framework_better_zebra.patch2.44 KB

Comments

#1

Ah, I notice what you mean. Your patch seems to work well. I was just about to remove zebra coloring altogether and return lists to just be Garland-style for the upcoming 2.3 release. I may need to re-examine how the zebra lists are styled. Thanks for this patch. What exactly happens with submenus with only one item? Can it be not resolved with specific CSS?

#2

Well, as far as I can see, the ideal way of doing menu zebra coloring would be to override menu_tree_output but currently this is not possible, see #283723: Make menu_tree_output() return renderable output

It will be just like to add zebra coloring to other lists overriding theme_item_list (As a side note I've already done that, tell me if you want to add that to framework).

I could try to improve my simple state machine to detect the "last item without a first item" case, here my code fails to detect depth change. Let's see what will come out.

Regards,
Antonio

#3

Hm, at this point, just for the sake of compatibility and simplicity, I may remove the zebra styling until some of these issues are fixed. I don't want to push out 2.3 with something that will not work well with some modules. Yet, I think leaving the even-odd-first-last functionality will be helpful to developers.

A goal of mine for 2.3 was to remove as much code as possible while still retaining a clean and easy to use theme, letting the default system.css take care of a lot of work. I became a little wary about the need to set up lots of commented-out code to disable certain features, such as the "legacy" lists which are just the same as Garland, so that something rather trivial like zebra striping could be done. Is it reasonable to assume that zebra striping is unnecessary for what is essentially a "starting theme"?

Let me know your thoughts on this. I'm a little torn about it.

#4

HI, yes, leaving out incomplete pieces is a good thing for framework IMHO.

Maybe you could add the zebra coloring for other lists as a demostration, and put a comment to tell that the proper way of doing it for menu won't work because some functions in core are not themeable yet.

I am attacching here a patch to show what I mean.

Regards,
Antonio

AttachmentSize
replace-menu-zebra-with-list-zebra.patch 4.14 KB

#5

Thanks for the feedback. I'll probably leave out the styling, but keep the function. What function do you think is best suited for a Framework release? The original, or one of the two you've provided here?

#6

You could provide the last one I've sent about other lists, along with the note about the menu issue.
Being the framework theme quite popular maybe the issue about menu_tree_output not being themeable would be solved more quickly: having users wonder about why you removed menu zebra coloring could be useful, that's what I mean.

Regards,
Antonio

#7

Removing zebra styling from menu, is a very much need feature for me. It is better to leave it on users.
Andre, you are doing a great job, I use this theme for most of sites I develop.

Thank you.
--
Sharique uddin Ahmed Farooqui

#8

Status:needs work» closed (fixed)

Framework no longer includes zebra coloring and has reverted to standardized list formatting.

#9

Category:bug report» support request
Status:closed (fixed)» needs work

I'm looking for a way to zebra stripe the menu. I've been playing around with zen and some other starter themes trying to accomplish it but haven't had much luck. Am I reading this thread correctly that it can no longer be done using Framework? Or was the above message just with regard to dhtml_menu? Could you suggest a resource that will give instructions on how to zebra stripe a menu, using Framework or anything else?

Thanks.

#10

bump

#11

The problem with single item menus has been fixed in 6.16, see #393632: Use both first and last class for single-item menu item..
My approach could work now.

In D7 there will be a better way to style menus btw.

Ciao,
Antonio

#12

@ao2 your theme_framework_better_zebra.patch is great for any multi-level menu!

I applied it to my base theme's template.php last week as I was seeing that multi-level menu colors were all over the place due to the basic method of zebra striping of odd/even menu items.

You saved me some development time!
Thanks!

#13

Component:Code» CSS/HTML markup
Status:needs work» closed (won't fix)
nobody click here