Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
There is currently a lot of code that does some heavy lifting in the local task themeable functions. This is a bit of a simplification. No HTML is changed by this refactoring.
To test this I tried making the local tasks hierarchical instead of two unordered lists. This was a easy change to do, with about 3 lines of changes.
Comment | File | Size | Author |
---|---|---|---|
#1 | menu.inc_2.diff | 6.08 KB | drumm |
Comments
Comment #1
drummComment #2
Bèr Kessels CreditAttribution: Bèr Kessels commented+1 from me.
This will make the code I am working on for primary/secondary links a huge lot easier.
Also: this makes tabs semantically correct.
Comment #3
Dries CreditAttribution: Dries commentedCommitted to HEAD.
Comment #4
(not verified) CreditAttribution: commentedComment #5
ax CreditAttribution: ax commentedthis (committed) patch removes the ability to return a rendered tree of all accessible menu items, a feature critical for DHTML expandable menu links.
is this supposed behaviour? "Make local tasks more themeable" doesn't suggest this.
is there another way to get an completely expanded menu tree with proper menu item class labeling? ie. for "node/add":
[ul]
[li class="***expanded***"]create content
[ul]
[li class="leaf"]blog entry[/li]
...
[li class="leaf"]story[/li]
[/ul]
[/li]
[li class="leaf"]my account[/li]
...
[li class="leaf"]submission queue[/li]
[li class="***collapsed***"]administer
[ul]
[li class="leaf"]access control[/li]
...
[li class="leaf"]...[/li]
[/ul]
[/ul]
if not, i would kindly request to reinstate this functionality. i will try to provide a patch, but would much appreciate any help, especially of those who have more experience with the menu system.
thank you!
Comment #6
drummIn your theme override theme_menu_local_tasks(). You are going to call a custom function instead of menu_secondary_local_tasks().
The custom function should be a copy of menu_secondary_local_tasks(). Perhaps name it mytheme_all_secondary_local_tasks(), although that is a bit long. Remove menu_in_active_trail() from the inner if statement. You will probably need to put in some more HTML to separate one group of local tasks from another.
Comment #7
ax CreditAttribution: ax commentedhm. ...local_tasks() is not about "primary" menus such as the navigation menu (create content, administer, etc), is it? but thats what i want to CSS/DHTML-dynamically expand and collapse.
for the time being, i got my dynamic menu working for 4.6 by rolling back this patch (and using theme('menu_tree', 1, TRUE)). but thats certainly not the way to go.
mind to elaborate the reasons you removed the $all parameter from theme_menu_tree()
? thanks again.
Comment #8
drummSo you do not need the full local task tree and need the full menu tree without any local tasks?
Comment #9
ax CreditAttribution: ax commentedexactly.
however, the local tasks could be made dynamic, too, so it would be nice if there was a way to get full local task trees as well.
Comment #10
drummI am okay with adding this functionality back in. It would probably involve naging this section of code:
I think this should be done with a new patch rather than reverting the old patch since the menu theme html is currently well separated from the logic. If no one else can code this I might have time to try later next week.
Comment #11
drummComment #12
drummDue to lack of interest from both me and people requesting this, this is nowhere near the top of my todo list, so someone else should take over.
Comment #13
bdragon CreditAttribution: bdragon commentedDing, dong, the old menu system is dead. (At least as far as API changes go)
As far as the new one, 'menu_tree_output', 'nuff said.