-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Initial POC for Navigation Overlay as template part #47116
Conversation
Size Change: +1.86 kB (0%) Total Size: 1.33 MB
ℹ️ View Unchanged
|
Thanks for diving in here ❤️ |
Flaky tests detected in 22286b1. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/3965683712
|
With the changes to the navigation list view and menu selection, this no longer works and it needs a new design. |
What?
Updates the navigation block to use a template part for the overlay.
Why?
Background: #43852
How?
WIP: This is still very buggy.
In the first attempt, the overlay template part id was stored as a block attribute.
Now the block tries to find a template part that matches the current menu, and it is not working yet:
Previous description
The PR adds a new Navigation Overlay selection option to the block settings sidebar. This option is similar to the menu selection. It is a select list that shows the available navigation overlay template parts and lets you select, create a new overlay, and edit the current overlay. When the option to Edit Overlay is selected, the template part is opened in isolation, and any block can be added.On the front the template part is shown when the responsive menu button is activated.
Why?
Background: #43852
How?
In short:
Adds a new block attribute that holds the postId of the assigned template part.
Selects all
wp_template_part
post types from the database, and filters the result to only include the navigation overlays.When an overlay is selected from the setting, the block attribute is updated.
The attribute is used to direct the user to the correct template part for editing,
and also for rendering the part on the front.
Testing Instructions
In the issue description, clicking this button should take you to the template editor.
Bug: This is currently not working because it tries to open the site editor inside the current editor iframe.
I also found it more difficult to select the block in the canvas when this button is set to open the template editor.
Phew.
Bug: If you tested the mobile menu overlay, you will also see that the template part is always displayed, even on full browser width.
Screen.Recording.2023-01-12.at.15.04.55.mov