[drupal-devel] [task] Make local tasks more themeable

ax drupal-devel at drupal.org
Fri Aug 12 19:05:01 UTC 2005


Issue status update for 
http://drupal.org/node/17869
Post a follow up: 
http://drupal.org/project/comments/add/17869

 Project:      Drupal
 Version:      4.6.0
 Component:    menu system
 Category:     tasks
 Priority:     normal
 Assigned to:  drumm
 Reported by:  drumm
 Updated by:   ax
 Status:       patch (code needs work)

exactly.


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.




ax



Previous comments:
------------------------------------------------------------------------

Thu, 24 Feb 2005 08:51:23 +0000 : drumm

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.




------------------------------------------------------------------------

Thu, 24 Feb 2005 10:19:58 +0000 : drumm

Attachment: http://drupal.org/files/issues/menu.inc_2.diff (6.08 KB)




------------------------------------------------------------------------

Mon, 28 Feb 2005 12:15:52 +0000 : Bèr Kessels

+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.




------------------------------------------------------------------------

Mon, 28 Feb 2005 16:23:44 +0000 : Dries

Committed to HEAD.




------------------------------------------------------------------------

Fri, 12 Aug 2005 15:09:10 +0000 : ax

this (committed) patch removes [1] the ability to return a rendered tree
of all accessible menu items [2], 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!
[1] http://drupal.org/node/5943#comment-38932
[2] http://drupal.org/node/5943#comment-10080




------------------------------------------------------------------------

Fri, 12 Aug 2005 17:46:51 +0000 : drumm

In 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.




------------------------------------------------------------------------

Fri, 12 Aug 2005 18:43:52 +0000 : ax

hm. ...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 [3] 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()



-function theme_menu_tree($pid = 1, $all = FALSE) {
+function theme_menu_tree($pid = 1) {

? thanks again.
[3] http://drupal.kollm.org/node/view/38




------------------------------------------------------------------------

Fri, 12 Aug 2005 18:48:25 +0000 : drumm

So you do not need the full local task tree and need the full menu tree
without any local tasks?







More information about the drupal-devel mailing list