Problem/Motivation
There are some hardcoded blocks which can't be placed, I think for display_builder_page_layout, this will be a blocker, src/Plugin/display_builder/Island/BlockLibraryPanel.php:
private const HIDE_BLOCK = [
'help_block',
'system_messages_block',
'htmx_loader',
'broken',
'system_main_block',
'page_title_block',
];
1: The help and system message should be available, either as blocks or as slot sources.
2: Currently the local tasks is implemented as a slot source (modules/display_builder_page_layout/src/Plugin/UiPatterns/Source/LocalTasksSource.php), the problem is that that way it does not obtain the config form from core/lib/Drupal/Core/Menu/Plugin/Block/LocalTasksBlock.php, so maybe need to make the local tasks available as block and no more slot source?
3: why local actions and local tasks, and page title slot source had been put into display_builder_page_layout? I understand that for main page content, but for the other they could theorically be used into entity view display or view, so why not move it into the main module?
4: module categories not appearing, see dedicated comment
Proposed resolution
Test to have blocks instead of slot sources.
Remaining tasks
User interface changes
| Comment | File | Size | Author |
|---|---|---|---|
| #11 | Capture d’écran du 2025-09-25 11-01-23.png | 246.83 KB | grimreaper |
| #11 | Capture d’écran du 2025-09-25 11-01-02.png | 226.99 KB | grimreaper |
| #6 | Capture d’écran du 2025-09-22 17-24-51.png | 47.7 KB | grimreaper |
Issue fork display_builder-3547972
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 #2
grimreaperComment #3
grimreaperAdding a feedback about block categories not respected.
Currently there are the following categories:
- the slot sources blocks
- Content management (from Dashboard module)
- List (Views)
- Menus
- Others
While on block layout when adding a block I see other categories:
- Chaos Tools
- Content block
- Sitemap
- System
- UI Patterns: I guess for those one it is normal as there is the Components library
- Webform
- etc.
I know that by default when a block plugin does not declare an explicit category, it fallback to the module providing the plugin. So maybe for some plugins it is that, but I have custom block plugins with explicit category not matching the providing module machine name and the category does not appear explicitly.
Comment #5
grimreaperProvided a draft for last point.
Comment #6
grimreaperIn display builder settings, only save enabled options. Example with exclude where no checkboxes checks but changes in the config.
See screenshot.
Comment #8
mogtofu33 commentedAdded a fix to not store empty values for exclude (and status).
Moved the choices group part of block as a helper because it was pretty hard to understand. Added a Unit test on it.
I changed the groups process with some new ones, and no more empty, with an arbitrary weight. @grimreaper if you can quickly review that it's still ok with your blocks? I put unknown at the bottom but perhaps could be higher.
Comment #9
grimreaperThank! assigning I will test tomorrow
Comment #10
grimreaperThat's way better!
I think other improvements could come later, no hurry.
Comment #11
grimreaperGot warnings with block preview.
Maybe that's why it was disabled.
Comment #12
mogtofu33 commentedCannot reproduce on the navigation menu block, I guess its "Main Navigation"?
If so any other contrib module doing something on the menu block?
As you can see in the backtrace I don't really handle the render, UI Patterns is doing, perhaps there is some options missing as we have none for preview.
Comment #13
mogtofu33 commentedWill merge the current work as it seems ok and keep the MR open for the follow up.
Will need an other fork for next work.
Comment #16
pdureau commentedWhat left do we need to do?
Comment #17
grimreaperComment #18
grimreaperComment #20
grimreaperComment #21
pdureau commentedLet's wait #3556521: Allows special blocks is merged before merging this one.
Comment #22
pdureau commentedIt seems to work well everywhere... but in
/admin/structure/page-layout/{page_layout}/builderwhere I get:Restoring this in DisplayBuilderPageVariant doesn't help:
Also, "Messages" block don't generate a placeholder when rendered empty.
Comment #23
grimreaperHello,
As seen together, I do not reproduce the warning.
And messages block is never empty, there is a placeholder div in case JS generates messages.
Comment #24
pdureau commentedComment #25
grimreaperComment #26
grimreaperSeen together, the remaining bug of Pierre was from an outdated version of ui_styles.
Comment #27
pdureau commentedComment #28
pdureau commentedComment #29
mogtofu33 commentedComment #30
grimreaperComment #31
pdureau commentedI will create a dedicated issue for beta2
Comment #32
pdureau commentedFollow-up: #3557692: LogicException: Render context is empty
Comment #34
mogtofu33 commented