Page List: add convert panel to Inspector Controls when within Nav block#46352
Merged
Page List: add convert panel to Inspector Controls when within Nav block#46352
Conversation
|
Size Change: +350 B (0%) Total Size: 1.32 MB
ℹ️ View Unchanged
|
Contributor
|
cc @jasmussen and @SaxonF |
Contributor
|
Closed by accident |
scruffian
reviewed
Dec 7, 2022
| <PanelBody title={ __( 'Customize this menu' ) }> | ||
| <p id={ 'wp-block-page-list-modal__description' }> | ||
| { __( | ||
| 'This menu is automatically kept in sync with pages on your site. You can manage the menu yourself by clicking customize below.' |
Contributor
There was a problem hiding this comment.
Is it worth extracting this paragraph to a shared component, so that we only have one copy?
MaggieCabrera
approved these changes
Dec 7, 2022
Contributor
MaggieCabrera
left a comment
There was a problem hiding this comment.
I prefer this solution too. It's simpler and lets the user customize the parent of the page list.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What?
Adds a new panel to the Page List block's inspector controls to allow for converting page list to navigation links. Only shown when block is within a Navigation block.
Alternative to #45984
Why?
When the Page List is shown within the Nav Offcanvas then we need a means to convert it to links without having to go over to the editor canvas.
The original suggestion was to bring up the "Convert to links" modal that appears when you click
Editin the block toolbar within the canvas. However this had several disadvantages, namely:The solution in this PR ensures a standardised user experience for all blocks within the offcanvas. Page List is no exception.
Now clicking the edit button in the offcanvas will show the inspector controls of the Page List at the top of which is the option to Customise the Menu.
How?
Downside of this PR as it stands is yet more coupling between Nav and Page List blocks.
Testing Instructions
Customise this menu.Testing Instructions for Keyboard
Screenshots or screencast
Screen.Capture.on.2022-12-07.at.10-01-03.mp4