Problem/Motivation
* This module has an implementation of hook_toolbar() that creates a top-level tab in the admin toolbar. Clicking this link simply opens a modal dialog to create a new block visibility group.
* The space available in the admin toolbar is very limited, so having items with long names on it can easily break the CSS, e.g. "Block visibility groups".
* The "Block visibility groups" item is related to the block system, so its link should be placed somewhere around the link for "Block" management.
Suggested solution
* Remove the tab on admin toolbar
* Optionally, place the same link under the "Blocks" link in the admin menu.
Please let me know if I can help further in any way.
| Comment | File | Size | Author |
|---|---|---|---|
| #9 | fix_block_visibility_groups_admin_perms.patch | 4.11 KB | finex |
| #3 | 2749583-3-remove-hook-toolbar.patch | 1.91 KB | jigarius |
| #3 | 2749583-3-create-admin-menu-link.patch | 557 bytes | jigarius |
Comments
Comment #2
tedbow@Jeff Burnz sorry it has taken me so long to get to this.
hook_toolbar is only in block_visibility_groups_admin. You don't need to turn that on.
Comment #3
jigariusHello! I've spent at least 1 hour today thinking that the "Block Visibility Groups" item on the admin toolbar was a bug. After an hour of investigation, I found out that it was being created by the block_visibility_groups_admin module.
IMO, it makes more sense to have a link to block visibility groups under the link to the block management page. This will free up space on the admin toolbar and it won't have a strong "in your face" effect.
I've created 2 patches.
Please let me know if I can help further.
@tedbow
Disabling that module will also remove the functionality provided by the "block visibility groups admin" module.
Comment #4
jigariusOops. Forgot to mark it as needs review.
Comment #5
crutch commentedThe patches work perfectly thank you!
---
I just created https://www.drupal.org/project/block_visibility_groups/issues/3243347 before finding this issue.
It also fixes this issue https://www.drupal.org/project/block_visibility_groups/issues/3239921
Closing both of these.
Comment #6
jigarius@crutch, thanks for testing my patch. Since you found the patch to be working, can you please mark the issue as reviewed and tested by the community?
Comment #7
crutch commentedComment #8
crutch commentedComment #9
finex commentedI don't agree with the removal of the button from the toolbar: it's very useful. A better approach is to add the permission check to the hook_toolbar() and change the routing permission for the page.
Comment #10
jigariusYou can always create a shortcut to it using the Shortcuts module that comes with core if you use it very often. IMO, the button is too specific to be in general place like the toolbar.
Comment #11
mlncn commentedAgree with having the admin of this module work like the admin of every module, accepting both the first patches.
Comment #14
mlncn commentedI do acknowledge that this, i think, takes away the functionality of the model overlay being contextually aware of 'active' visibility groups suggesting conditions based on the current page— personally, those features have always been more in-the-way and confusing than helpful, but i'd accept an option or sub-sub-module to bring it back if it is important to anyone's workflow, but the module will be easier for new users without that i think.