allow more flexible theming of nice menus
hunmonk - July 24, 2007 - 03:02
| Project: | Nice Menus |
| Version: | 5.x-1.x-dev |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | hunmonk |
| Status: | closed |
Description
attached patch abstracts the theming functions for nice menus a bit more. this opens up a lot more possibilities, like using the nice menu logic for primary/secondary links in a theme.
here's what i've done:
- added an optional $menu argument to the relevant theming functions. this allows a power themer to pass a custom menu tree to the theming function. probably won't be used all that often, but nice to have :)
- created a general theming function for wrapping the final ul's. this also controls the nice menu id and the direction.
- cleaned up the block code to use the new theming functions.
- added a theme_primary_nice_menu_links() function. this is basically a helper function for themers to add primary nice menu links.
tested with both regular block nice menus, and with primary links nice menus at http://dominatefantasyfootball.net (hover over 'Blogs'). works beautifully in both cases as far as i can tell.
| Attachment | Size |
|---|---|
| nice_menu_theme.patch | 5.09 KB |

#1
better name for the primary links theme function. everything else is the same.
#2
added another arg to the primary links theme function, since we shouldn't assume that they will always expand down. instead it defaults to down, and can be overridden.
#3
Suweeet! Thanks hunmonk. Committed to 5.x-1.x-dev.
#4