-
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
Experiment: try using inner blocks for the page list block #39087
Conversation
Size Change: -198 B (0%) Total Size: 1.15 MB
ℹ️ View Unchanged
|
One nice-to-have thing about this approach is that, even if you wouldn't be able to edit the links, stuff like the "Copy" option in the ellipsis menu would still be available, allowing you to easily copy a navigation link from a pre-existing dynamic menu to a static one that you're working on. |
Wow, yes, that would be a very nice feature. This is giving me scary thoughts of how challenging it was to reorder classic menu items via the REST API in the navigation editor (I think it would be a similar technical challenge). But it's definitely not insurmountable. I think we probably need to move towards a solution more like the query block, where we make more use of the entity system. It would be interesting if the list of blocks were synced automatically to the page entities (and their order), and then using the block movers automatically generated the necessary unsaved changes to the order field for each page.
Yep! URL is a good example. It wouldn't be something that should be editable. But then I think we have the same issue with the Navigation Link block anyway. In an ideal world it would be connected to a page via its |
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.
This seems to be a bug in edit: Fix for that in #39151, which I'll try to get cherry-picked into the 12.7 plugin release. |
I'll close this PR, as it isn't something that I'll have time to continue on, but if anyone wants to use this code as the basis for another PR, feel free. |
Description
This is a fairly simple experiment that attempts to use inner blocks for the Page List block in the editor. It does so by creating a locked template of Navigation Link blocks. Each block is also locked to prevent removal or moving.
The thing that prompted me to explore this is #38600, which looks at using List View to display site navigation. A shortcoming of Page List in this context is that it doesn't show its child pages in List View because they're not blocks. This resolves that, now we get to see the full page hierarchy in List View:
I think there are also advantages in code reuse. The Navigation Block is now using the defacto nav link blocks instead of reproducing their markup. It should avoid any issues with code or style drift.
It also fixes #38733.
There are some problems to solve:
Testing Instructions
Screenshots
Types of changes
Experiment
Checklist:
*.native.js
files for terms that need renaming or removal).