Problem/Motivation
It is currently possible to edit and remove a block from the front-end theme using the contextual menu, this provides quick access to manage blocks without having to load the Block Layout admin page and is great for making quick edits to the blocks. The full Block Layout admin page provides a third option - to disable the block; it would be very useful if this option were to be available from the contextual menu.
Proposed resolution
Provide a contextual menu to disable a given block.
Remaining tasks
Provide a patch with the suggested change.
User interface changes
Contextual menus for blocks would include a new option to disable that block.
API changes
TBD
Data model changes
TBD
Release notes snippet
TBD
| Comment | File | Size | Author |
|---|---|---|---|
| #13 | disable-block.png | 89.53 KB | prashant.c |
| #13 | 3357596-contextual-menu-disable-block-10.3.x.patch | 490 bytes | prashant.c |
Issue fork drupal-3357596
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #5
vbouchetContextual link added, tests updated.
Comment #6
smustgrave commentedAppears to have a test failure.
Have not tested.
Comment #8
mlncn commentedIt feels kind of tautological, but i guess no more than the other tests, looking at "Explicitly add and validate tokens" in the CSRF access checking documentation it looks like generating the URL like this would work:
Comment #9
prashant.cThis is a quite good improvement in the admin interface, will save from multiple clicks and navigation to disable a block.
The "disable block" is working properly as a contextual item
https://www.awesomescreenshot.com/video/28941116?key=7a42ca1e10b8f8ca8bf...
Comment #10
prashant.cComment #11
prashant.cJust a thought we can have the ordering of the links in alphabetic order or basically "Remove" at the end because that will completely remove the block.
Comment #12
summit commentedHi, would it be possible to have a patch for this in Drupal 10.3?
I am looking for this functionality in latest stable Drupal version.
Thanks for your reply in advance,
Greetings,
Comment #13
prashant.c@Summit
Please try the attached patch, it does not include tests as those are failing currently, It only consists of the change to provide an additional "Disable block" contextual menu item.
Comment #14
summit commentedHi, tried https://www.drupal.org/project/drupal/issues/3357596#comment-15693587
and indeed a -disabled block- feature arises.
But the block is still shown. And there is no -enabled block- feature. So I do not know if it is working?
greetings and thanks for building this,
Comment #15
prashant.cCould you please attach a GIF etc. in which we can see the disable block not working and if you have any error in your "Recent log messages" page?
Comment #16
summit commentedHi,
I can't show a GIF. It is just still there. I can send you a small video clip I made?
No error in the errorlog, sorry.
Greetings,