-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
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
|
cc @jasmussen and @SaxonF |
Closed by accident |
<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.' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it worth extracting this paragraph to a shared component, so that we only have one copy?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I prefer this solution too. It's simpler and lets the user customize the parent of the page list.
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
Edit
in 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