In the 7.x version of the module, if one navigates to the 'Structure' -> 'Views' menu, these are the menus/submenus they see:
- Add new view
- Edit
- Edit
- Edit
...
- Edit
- Import view from code
- Tools
- Basic
- Bulk export
- Convert
Now, there might be a different number of such 'Edit' links (also depends on which modules you have installed), but no matter if the respective view is enabled or not, it still shows its 'Edit' link (points to ../admin/structure/views/edit/[view_name]).
It would be more appropriate to display the view names instead of simple meaningless 'Edit' menu items and have them show either 'Enable' or 'Edit'/'Export'/'Clone'/'Disable' child items, depending on their status (view is enabled or not). Like so:
- Add new view
- archive (default)
- Edit
- Export
- Clone
- Disable
- comments_recent (default)
- Enable
- frontpage (default)
- Edit
- Export
- Clone
- Disable
...
- taxonomy_term (default)
- Enable
- Import view from code
- Tools
- Basic
- Bulk export
- Convert
Comment | File | Size | Author |
---|---|---|---|
#28 | admin_menu.views-map.28.patch | 815 bytes | sun |
#14 | drupal_admin_menu_OK.png | 73.29 KB | rudiedirkx |
#12 | custom.txt | 480 bytes | tomas.teicher |
#6 | screen_drupal7_menu_views.png | 26.1 KB | rudiedirkx |
#3 | add_views_names_next_to_their_edit_links.png | 32.21 KB | klonos |
Comments
Comment #1
klonos... sorry, should have enclosed the menu structures in <code> tags. Someone with the permission to edit issue description please correct that for me.
Thanx.
Comment #2
tim.plunkettThis patch "works". It's not elegant, and it doesn't do everything listed above.
This patch creates a link "Edit %viewname" for all enabled views and a link "Enable %viewname" for all disabled views.
Having a menu like
would be nice, but views don't have their own page, so comments_recent (default) and Edit would be redundant.
This probably needs some help, and definitely needs comments. I'm marking it as needs review though, just to make sure I'm on the right track.
Comment #3
klonosNot much action on this one :(
...here's a screenshot of the issue + another screenshot of the menu after the patch is applied. With the patch applied in latest dev of the module, under latest D7-dev core and once caches are flushed I do see the enabled views' names next to the 'Edit' text. I do NOT see any entries for the disabled views though. Also, I receive a series of repeated (146 times with the default set of views - if that makes any difference) error messages of:
Notice: Undefined index: hook in admin_menu_merge_tree() (line 266 of /var/www/d7test/sites/all/modules/admin_menu/admin_menu.inc).
I don't know if this is the cause of disabled views + their respective 'Enable' submenus not being displayed. Setting it to 'needs work' because of the above.
Thanx for your work Tim ;)
PS: I think I'd like it better if the menu items said 'Edit [view_name] view', because 'Edit admin_content' and 'Edit admin_users' might be misleading for example.
Comment #4
tim.plunkettI'm surprised the patch even applied anymore. I'll take another look at this soon.
Comment #5
klonosThanx in advance ;)
Comment #6
rudiedirkx CreditAttribution: rudiedirkx commentedThis issue is still not resolved.
Comment #7
sun@smk-ka once created a patch for Views to fix this, but that was >1 year ago, and unfortunately, I've never seen its contents.
This current patch here contains special code for Views, which is a no-go. We need to fix this properly.
Perhaps it might also be a good idea to remove the Views UI support code from admin_menu and add the hook implementation to Views UI instead.
Comment #8
Dave Reid+1 for removing views_ui support until it can be worked out where it needs to be and how it needs to be done
Comment #9
klonosThen perhaps this issue here needs to be set to 'postponed' till this happens. Anyone filled a new issue for that in the Views issue queue? If so, then please link.
Comment #10
tim.plunkettI feel guilty for having left this assigned to me.
Comment #11
ropaolle CreditAttribution: ropaolle commentedSubscribe
Comment #12
tomas.teicher CreditAttribution: tomas.teicher commentedI made javascript workaround while the module solution is out. Hope this helps. Works for me in mozilla and chrome (I don't use IE for administration)
Comment #13
echoz CreditAttribution: echoz commentedsubscribe
Comment #14
rudiedirkx CreditAttribution: rudiedirkx commentedTim's patch works fine: http://drupal.org/node/884032#comment-3336176
I've (manually) patched two files with it and now decent titles are shown.
Comment #15
tim.plunkettThe Views 3 UI was just merged in, so everything is different. I'll try this again.
Comment #16
tim.plunkettJust a heads up: Views now depends on CTools to define many of its menu items, via ctools/includes/export-ui.inc.
In my installation, admin/structure/views/add, admin/structure/views/add-template, admin/structure/views/settings are all in line with admin/structure/%.
Instead of admin/structure/views/edit/%view_name, its admin/structure/views/view/%view_name/edit.
Also, the links provided by Ctools are not in menu_links, which prevents them from being displayed.
Comment #17
tim.plunkettOkay, this is much less confusing now in light of #1127410: Views Admin Breadcrumb Missing.
Comment #18
klonosI thought I'd give this another go, so a couple of quick questions @Tim:
1. are you working on this at all atm?
2. based on #16 should I even dare to apply #2?
Comment #19
tim.plunkett@klonos, I'm not working on this at all. And I'm 99% sure my patch is useless now, even as a starting point...
Comment #20
klonosk, I kinda already knew but had to make sure. I appreciate you even took the time to reply.
Comment #21
klonos...setting it to a status that means more "we need to start over" (as per #16, #17, #19 etc.) than "we need to work on what's already done".
Comment #24
sunSorry for the noise; now for real.
Comment #25
klonosNow, there are no "Edit" links at all available in the menu. Shouldn't we get them back first?
Comment #26
sunKeeping this here for now, until the hook implementation has been moved over to http://drupal.org/project/admin_views
Comment #27
sunoh, I'm terribly sorry! #26 is total BS. admin_views has nothing to do with this issue :)
Comment #28
sunAttached patch works for me.
Comment #29
sunThanks for reporting, reviewing, and testing! Committed to all branches.
A new development snapshot will be available within the next 12 hours. This improvement will be available in the next official release.
Comment #30
klonosIt works fine. The only thing is that some views names are so long (and the width of the li only 160px) that they wrap to 3-4 lines for some cases. This will get worse as the number of enabled views increases for a site and since the Structure -> Views item is already the last in the menu, it will cause the last views listed to "hide" off the screen.
Could we somehow ad a class to the specific li tags so we can target them in css and increase their width?