-
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
Add page-list to blocks that needs list item wrapper #61482
base: trunk
Are you sure you want to change the base?
Add page-list to blocks that needs list item wrapper #61482
Conversation
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
👋 Thanks for your first Pull Request and for helping build the future of Gutenberg and WordPress, @saulirajala! In case you missed it, we'd love to have you join us in our Slack community. If you want to learn more about WordPress development in general, check out the Core Handbook full of helpful information. |
Hey @ajitbohra 👋 Any change to get this fixed before WP6.7 release? |
@saulirajala Thanks you for the PR and for your diligence in updating it in line with changes for WP 6.7. I've requested reviews from a few folk familiar with the block so hopefully we can get some reviews soon. |
Thanks for making the PR, sorry for the delay in anyone getting back to you. In terms of the solution, I think it might be better to go the other way, and remove the Page List's use case in the navigation block is a quick way to add a set of navigation links, and any other individual navigation links added alongside it should appear visually as the same set of links, and also be that way in terms of the HTML hierarchy. (IMO) It looks like there's precedence for this, as if you add Page List in a submenu alongside a custom link, it already works that way, the
Here's where it's determined. It might be a simple adjustment to make this work: gutenberg/packages/block-library/src/page-list/edit.js Lines 264 to 280 in 5513d7a
@draganescu's PR #46414 implemented that, so Andrei might have some advice. |
@saulirajala Do you feel you would have time to make the adjustments here? No rush but wanted to check as it's on my radar to keep track of. Thank you. |
What?
Wrap
core/page-list
with list item wrapper when its innerBlock ofcore/navigation
Closes #60500
Why?
Fix for #60500. When you use page-list -block as inner block of navigation block, there will be invalid html code
<ul><ul><li></li></ul></ul>
-structure in the frontend.Testing Instructions
<ul><li><ul><li></li></ul></li></ul>
-structure, which is valid htmlScreenshots
Before
![Screenshot 2024-05-08 at 13 31 30](https://private-user-images.githubusercontent.com/5536354/328856504-ae489d8b-4170-43e0-93e3-1c12d61a239b.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk1MTkyNTgsIm5iZiI6MTczOTUxODk1OCwicGF0aCI6Ii81NTM2MzU0LzMyODg1NjUwNC1hZTQ4OWQ4Yi00MTcwLTQzZTAtOTNlMy0xYzEyZDYxYTIzOWIucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDIxNCUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMTRUMDc0MjM4WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9YTk4OTAxYWFkYWYwOWYxMmE5ZWRmYWZmYmI4NTY1YzhlMDg3ZTY3YmM1YjYzMGMyZjY5NTBjNDVmOGFhNzk2OSZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.q90Iyttt2mH_lllp9zG1dx2bQVMtVaR9Rck58mHYK_0)
After
![Screenshot 2024-05-08 at 13 31 10](https://private-user-images.githubusercontent.com/5536354/328856576-633993e0-ee58-4001-8c86-bf40bd070169.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk1MTkyNTgsIm5iZiI6MTczOTUxODk1OCwicGF0aCI6Ii81NTM2MzU0LzMyODg1NjU3Ni02MzM5OTNlMC1lZTU4LTQwMDEtOGM4Ni1iZjQwYmQwNzAxNjkucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDIxNCUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMTRUMDc0MjM4WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9ODEyNGVhYjA4NWE5N2RjMzQ4OWFkM2E3Yjc3NGNmYjdjNGI3ZTcwODVkODZiODg4ZGM5Mzk5NGNjOGMzZDQwOSZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.bvZaGDg1desuYEoLqK-Hg_TzAZtQUHGfybr5aTc5KI8)