Move local tasks into menu with PHP, not JS
| Project: | Administration menu |
| Version: | 7.x-3.x-dev |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Jump to:
I think that local tasks should be moved into admin menu at the server with PHP instead of on the client with JavaScript for at least three reasons:
- It seems inefficient to create HTML on the server only to have the client remove and replace it.
- The aforementioned process (#2) can result in an experience like a flash of unstyled content where there is an initial rendering of the page followed by a sudden change.
- Finding the tabs with jQuery is too sloppy. It's looking for
ul.tabs.primary li. If your theme uses any other HTML structure to display them, they won't be found. It seems more fool proof to override tab display with a Drupal hook.
Related issues (which I don't list among my primary reasons because they could be addressed by merely changing the JavaScript a little) are that 1) the process leaves an empty DIV in the page which may inherit some styling that must be overridden, 2) and that the tabs when moved into the admin menu also tend to inherit styling intended for display on the page. (It took a site or two before I realized that my tabs.css was creating the white text on white background dropdowns on my webform edit tabs so.) Those're my thoughts. What does everyone else think?

#1
This feature is most probably only used by a few people. So whatever you suggest, you at least need to kick-start development with an initial patch, which approves that your suggestions are actually doable.