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.

AttachmentSize
nice_menu_theme.patch5.09 KB

#1

hunmonk - July 24, 2007 - 15:34

better name for the primary links theme function. everything else is the same.

AttachmentSize
nice_menu_theme_0.patch 5.09 KB

#2

hunmonk - July 24, 2007 - 16:37

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.

AttachmentSize
nice_menu_theme_1.patch 5.2 KB

#3

add1sun - July 25, 2007 - 00:24
Status:needs review» fixed

Suweeet! Thanks hunmonk. Committed to 5.x-1.x-dev.

#4

Anonymous - August 8, 2007 - 00:35
Status:fixed» closed
 
 

Drupal is a registered trademark of Dries Buytaert.