Closed (fixed)
Project:
Better Jump Menus
Version:
7.x-1.3
Component:
Miscellaneous
Priority:
Major
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
7 Mar 2012 at 17:15 UTC
Updated:
17 Apr 2012 at 17:44 UTC
Any thoughts on how to achieve placing local menu tasks into a jump menu?
Comments
Comment #1
doublejosh commentedHmm, the effect could be pretty nice; like getting node tabs into an edit drop down. Hot!
I know that admin menu (at least in D6) has a setting to move local tasks to the admin menu. Not sure if that temporarily placed those items in the menu or just make it appear so. Mind investigating?
Comment #2
pixelsweatshop commentedI have been looking into this for a while now. Node tabs can get out of hand, especially when doing responsive design. Jump menus work very nicely to clean this up.
Investigated this further. Admin menu does still have this setting, however, once enabled, it doesn't add it to the menu. Just makes it appear so.
Comment #3
doublejosh commentedAssuming then it just places the tabs styled the same way at the end of the menu. Bummer.
Questions now become what's the desired effect (that still maintains some flexibility for other uses), what kind of admin choices should be there and how this should be done. Could have an option to place ALL local menu items in a jump menu block. Perhaps a content type setting, if that's the goal.
Implementation...
Will need to add to the hook_block to create one to house local menu tasks.
Then remove them from the normal location.
Not sure how to pull in all the tasks within the block display code.
Some resources...
menu_primary_local_tasks() menu_secondary_local_tasks() http://drupal.org/node/199067
hook_menu_alter() http://drupal.org/node/483324
Comment #4
pixelsweatshop commentedWe can look to see how it was achieved in http://drupal.org/project/dropdown_tabs
Comment #5
doublejosh commentedAwesome find!!!
I'll just reach out to them and see if I can borrow their functionality and integrate it here.
Comment #6
doublejosh commented#1484360: Can I borrow your code?
Comment #7
doublejosh commentedThey didn't get back so I'll go for it.
Planning to create a block that will display whatever local menu tabs are present within a select drop down and remove the current tabs.
Actually, it's more like I'm hoping that's possible from the code I'm going to borrow plus a little more effort.
Comment #8
doublejosh commentedComment #9
pixelsweatshop commentedSounds great. However the thought of automatically removing the current tabs, once the block is enabled, might be making the assumption that one wants to replace them. For example, in a responsive design, one might want to keep the regular tab UI for a wide layout, but only display a jump menu when in a mobile layout. I think just providing a block (just like this module does with any other menu group- e.g. main menu) is sufficient. Thoughts?
Comment #10
doublejosh commentedRight. Reduce assumptions. Guess that's why I posting here about what I should do. Any other thoughts before coding? Similar uses?
Comment #11
doublejosh commentedCommitted: be6c54fb98819c55f69a7b18764f3cc27aa7d4b9
The code from dropdown_tabs was pretty much useless, 112 lines rather than 23.
Please test (not released).
A useful screenshot for the project page might be nice.
Comment #12
pixelsweatshop commentedIt works like a charm. Well done!
I opened up a few other issues for review after reviewing. Sorry about posting them separately, but it's probably better to deal with them individually. Feel free to close them as 'won't fix' as they are just minor and really this module is great the way it is currently.
#1504514: Utilize block title instead of --Select desitation--
#1504520: Retain previous choice as "selected" menu item
#1504524: Update .info file to reflect new name
#1504528: Hide blocks when permissions causes empty list
Comment #13
doublejosh commentedTotally fine. Thanks for partitioning the concerns.
There may still be an issue about secondary local tasks. Do you have time to test that and think about use cases?
Comment #14
pixelsweatshop commentedAbsolutely. I would love to see this module mature. I have already implemented this module in several sites and plan on adding to all of my projects. Jump menus are a perfect and simple solution to the responsive design dilemma about large navigation in smaller screen sizes.
What issues do you foresee?
Comment #15
pixelsweatshop commentedJust discovered an issue with local menu tasks. There isn't support for secondary level tabs, only primary.
To test this, just install a module like simplenews. This will automatically add a secondary level to your user account (See it by clicking on edit on your account). This will affect modules like profile2, messaging/notifications framework, commerce etc. Might need some code to display child items much like other menus.
Comment #16
doublejosh commentedYou've brought up exactly why I was getting at :)
Was looking to hear your suggestion so I could have another voice before coding anything.
Comment #17
doublejosh commentedRemove blocks when permission reduces list to zero. #1504528: Hide blocks when permissions causes empty list
Comment #18
pixelsweatshop commentedIf it is possible to just list the menu items like the other menus (i.e. parent-child) then I think that would make more sense than having a separate jump menu for each.
As a sidenote, I find it very interesting discovering the numerous pitfalls in implementing something that seems so trivial on the surface, as adding jump menus to local tasks :)
Comment #19
doublejosh commentedThat was my thought was to try and fetch all the lineage.
But I thought since secondary menus are normally so small, one might want to keep them as a normal menu after entering the specific task area.
No?
Comment #20
doublejosh commentedComment #21
doublejosh commentedComment #22
doublejosh commentedYeah, those items are not present unless you're actually within the appropriate primary tab (tested using webform for webform nodes).
Comment #23
doublejosh commentedPosted on Drupal Stack Exchange looking for extra help to gather these items.
Comment #24
doublejosh commentedAdded in secondary menus at least when you're in the context and they are available.
67d3cbd2766a276c444ac4118c500464582395e6
Comment #25
doublejosh commentedComment #26
doublejosh commented@nicoz, worth a release with just in-context secondary local tasks?
Comment #27
pixelsweatshop commentedI think so. :)
(Great work BTW)
Comment #28
doublejosh commentedWilling to test the update?
(not on production)
Comment #29
pixelsweatshop commentedJust tested. Works well.
Comment #30
doublejosh commented