theme_nice_menu_primary_links is a nice little helper-function. It'd be nice to have one for secondary links as well, especially now that that comes in Drupal 6+ by default.
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | nice_menus-theme-secondary-links_340105-1.patch | 1.41 KB | add1sun |
Comments
Comment #1
add1sun commentedpatch attached. not tested.
Comment #2
add1sun commentedAdded to HEAD.
Comment #3
chrisfromredfinWhen secondary links source is set to primary links, theme_nice_menu_secondary_links still renders the top level (primary links). I would expect it to render the tree one-level below where you currently are (as theme('links', $secondary_links) does). Is this a poor expectation on my part?
I would think the function would need to check to see if the source for secondary is the same as the source for primary, and if so, custom-build $menu by kind of "shifting off" a level. I am thinking through an approach for that, but I don't know a ton about the 6x menuing system yet. If you have any insights, I would welcome them!
Comment #4
add1sun commentedah, you mean actually using the relationship of things? hrm. yeah that isn't what is intended, but i can see the expectation. :/ I hadn't thought someone might do a primary menu and then want the secondary for primary to be a dropdown. I think that maybe nice_primary_menus was designed for that concept maybe. I'll have to look at it since i never played with it.
Comment #5
chrisfromredfinOK I think I *might* have an OK solution. Before I submit it as a patch, I'd like to know if the approach is reasonable. Also, if you have any suggestions for the helper function names, etc.
(Or, perhaps you'd rather I just attach a patch... if so, let me know.)
The new theme_nice_menus_secondary_links():
this code is largely borrowed from menu.inc's menu_navigation_links()
I also realize that I could put this helper function at my theme level, like in template.php, and just call theme_nice_menus_secondary_links() or a similar nice_menus theme function, passing it this custom $menu. So I'm not sure if you think that this should be part of your module or a snippet for people to dump in their own template.php. Based on personal experience, as you know, I expected it to do this.
Comment #6
Audiowave commentedim trying to have my secondary links as dropdown menus, they have no relation to my primary links. Does the latest version have this feature or do i need to run the patch from post?
Thanks.
Comment #7
chrisfromredfinthe -dev version of nice_menus will support what you need natively, my code is only if secondary links is set to primary links