Problem/Motivation
There are actually two problems here:
1. Install Layout Builder Modal and enable Layout Builder and override on Basic page content type.
2. Create a basic page. Go to the layout of that node. Open some of the blocks through the contextual link Configure block.
3. Uninstall the module.
4. Go back to the layout of the created node. Try open the same blocks by the contextual link.
Expected behaviour:
They should be opened in off-canvas.
Current behaviour:
They are opened in the modal.
The second problem is that if you change some of the modal settings, the new settings are not applied to the contextual links until the session storage is cleared.
Contextual links are stored in the sessionStorage in the web browser. Is there something we can do about that?
Proposed resolution
Remaining tasks
User interface changes
API changes
Data model changes
Release notes snippet
| Comment | File | Size | Author |
|---|---|---|---|
| #7 | interdiff_4-7.txt | 1.62 KB | johnwebdev |
| #7 | 3058559-7.patch | 3.33 KB | johnwebdev |
| #7 | 3058559-7--test-only.patch | 1.36 KB | johnwebdev |
| #4 | 3058559-4.patch | 2 KB | johnwebdev |
Comments
Comment #2
johnwebdev commentedNot knowing the Contextual API too well, there seem to be a metadata property that we could use to handle this.
Comment #3
johnwebdev commentedIt looks like it's too late to set new meta data in both:
hook_contextual_links_view_alter
hook_contextual_links_alter
We cannot use a block subscriber on SECTION_COMPONENT_BUILD_RENDER_ARRAY event because the Layout Builder render element will override the #contextual_links key.
This leaves us to add a pre_render element to the actual Layout Builder render element. I have a working patch locally that needs some clean up. But it solves the problem, yay!
Comment #4
johnwebdev commentedHere's a first patch
Comment #5
johnzzonLooks good!
One nit:
Exceeds 80 chars.
Comment #6
johnwebdev commented#5 Thanks!
Setting back to NW for tests. Also working on this :)
Comment #7
johnwebdev commentedComment #10
johnwebdev commented