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.

Comments

Jeff Burnz created an issue. See original summary.

tedbow’s picture

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

jigarius’s picture

Title: hook_toolbar() ? » Remove hook_toolbar()
Issue summary: View changes
StatusFileSize
new557 bytes
new1.91 KB

Hello! 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.

  1. Patch 1 simply removes the tab from the admin toolbar.
  2. Patch 2 adds the link under the "Admin > Structure > Blocks" item.

Please let me know if I can help further.

@tedbow

hook_toolbar is only in block_visibility_groups_admin. You don't need to turn that on.

Disabling that module will also remove the functionality provided by the "block visibility groups admin" module.

jigarius’s picture

Status: Active » Needs review

Oops. Forgot to mark it as needs review.

crutch’s picture

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

jigarius’s picture

@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?

crutch’s picture

Status: Needs review » Reviewed & tested by the community
crutch’s picture

Version: 8.x-1.0 » 8.x-1.x-dev
finex’s picture

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

jigarius’s picture

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

mlncn’s picture

Agree with having the admin of this module work like the admin of every module, accepting both the first patches.

  • mlncn committed c43ada4 on 8.x-1.x authored by FiNeX
    Issue #2749583 by jigarius, FiNeX, crutch, Jeff Burnz, mlncn, tedbow:...

  • mlncn committed 90e9078 on 8.x-1.x authored by FiNeX
    Issue #2749583 by jigarius, FiNeX, crutch, Jeff Burnz, mlncn, tedbow:...
mlncn’s picture

Status: Reviewed & tested by the community » Fixed

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

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.