Add sidebar options for Drupal block configuration

Created on 18 September 2018, over 6 years ago
Updated 11 November 2021, about 3 years ago

All Drupal core blocks are listed in the editor, but none have any options in the sidebar. We need a way to expose block options inside Gutenberg per block.

Example: Menu block config options

And, of course, those settings should be saved on the block comment as json. Example:

<!-- wp:drupalblock/system-menu-block-account {"blockId":"system_menu_block:account", "settings_level": "1", "settings_depth": "2"} /-->
Feature request
Status

Fixed

Version

2.0

Component

Code

Created by

🇳🇴Norway perandre

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇩🇪Germany AgathaCrystal Potsdam

    Hi,

    so I tested the functionality and it seems like in combination with ctool this solution breaks.

    Steps to reproduce:

    1. Fresh Drupal installation (10.0.9, PHP 8.1.16, MariaDB) with Gutenberg & ctools (with ctools blocks and views activated) installed
    2. Add taxonomy to contenttype
    3. Create block view, add exposed filter for the taxonomy, set allowed block settings to "Configure filters"
    4. Activate the block view in the gutenbergexperience of a contenttype
    5. Create node with gutenberg, add the block view, setup the settings
    6. Settings dont effect the block, after saving the settings of the block wont open anymore and i get the following error:

    TypeError: Drupal\Core\Form\FormState::setUserInput(): Argument #1 ($user_input) must be of type array, string given, called in /var/www/html/web/modules/contrib/ctools/modules/ctools_views/src/Plugin/Display/Block.php on line 243 in Drupal\Core\Form\FormState->setUserInput() (line 996 of /var/www/html/web/core/lib/Drupal/Core/Form/FormState.php).


Production build 0.71.5 2024