Problem/Motivation

I was a bit surprised when I installed this module and the section storage, moving a block, and more were not in modals but still off canvas.

I would expect all of Layout Builder to be within modals for the same editor experience.

Steps to reproduce

Install. Configure section. Get off canvas

Proposed resolution

Instead of checking allowed routes, inspect if its a section storage route and apply modals.

Remaining tasks

User interface changes

API changes

Data model changes

Command icon 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

mglaman created an issue. See original summary.

mglaman’s picture

Status: Active » Needs review
johnwebdev’s picture

Hey, thanks for the feature request. I just tested the patch and it works!

I'm not entirely sure about it though. I think we might need to make this one configurable if we should commit it.

If you by accident click on the wrong block you try to add, you can just close the modal and select the right one in (the still opened) off canvas, where as with this, you need to click the Add block again and then select the correct block.

ebremner’s picture

Supplied is a patch that makes all the modals configurable.

Configure layout builder modal settings

gaurav-mathur’s picture

Assigned: Unassigned » gaurav-mathur
gaurav-mathur’s picture

StatusFileSize
new32.13 KB

Hi i just tested the patch #5 and it works.

gaurav-mathur’s picture

Assigned: gaurav-mathur » Unassigned
imalabya’s picture

Status: Needs review » Needs work

Inline block selection still opens in the tray instead of the modal.

sakthi_dev’s picture

Status: Needs work » Needs review
StatusFileSize
new3.75 KB

Addressed issue mentioned by @imalabya. Please review.

Status: Needs review » Needs work

The last submitted patch, 10: 3214458-10.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

sakthi_dev’s picture

Status: Needs work » Needs review
StatusFileSize
new30.59 KB

As the search in Choose block not working, added JS. Please review.

digitalfrontiersmedia’s picture

StatusFileSize
new30.62 KB

If for any reason one of the checkbox options is not chosen and the configuration form is saved that way, $route_names is no longer defined and you get complete page failures in Layout and the Layout Builder Modal configuration page--preventing you from being able to fix it. Thus, once done, this breaks LB on your site and requires some sort of configuration import or uninstallation of the module to reset.

Offering just a minor change to sakthi_dev's patch in #12 above that incorporates a failsafe variable initialization for $route_names to prevent this from possibly happening:

  // Get the use modal settings.
  $use_modal = $config->get('use_modal');

  $route_names = [];

  // If there are use modal settings, add the routes
  // that are in the settings to the route names array.
  if ($use_modal) {

Status: Needs review » Needs work

The last submitted patch, 13: lb-operation-modal-3214458-13.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

digitalfrontiersmedia’s picture

StatusFileSize
new31.22 KB

This patch same as #13 but incorporates the codesniffer fixes.

mortona2k’s picture

Manage Attributes for Layout Builder Sections Config module isn't accounted for.

joelseguin’s picture

I've tried the latest version of the patch (#15) against Drupal 11.2.4. Everything is working nicely, no errors in console nor in the Drupal events log.

I too was surprised this wasn't part of the module's original scope and initially thought I had missed a config option. Adding the patch definitely helps with consistency and tightens up the whole user experience quite a bit. Happy to test further if needed and looking forward to getting the patch merged.