Skip to content
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 placeholder to Page List block #45871

Open
wants to merge 1 commit into
base: trunk
Choose a base branch
from

Conversation

artemiomorales
Copy link
Contributor

What?

Addresses issue #44486 — if a site has no pages, this PR adds a placeholder to the Page List block whenever it is a child of a Navigation block.

Why?

This is to improve the user experience for folks whose main intent is to have no pages; it makes the content in the editor more closely match the published site and reduces clutter.

How?

It adds a placeholder and styling to the Page List block.

Testing Instructions

  • Remove all pages
  • Look at a Navigation block whose child is a Page List (if no such blocks exist on your page, create one)
  • You should see the placeholder displayed

Screenshots or screencast

Screen Shot 2022-11-17 at 5 19 x53 PM

Additional Notes

  • The issue this PR is linked to lists having no menus as a requirement to reproduce this; however, the triggering condition is simply having no pages — as long as the Navigation block is not configured with a menu and the Page List is a child, the new placeholder will appear.
  • I'm not sure if there are any accessibility considerations with this. Please let me know if so!

When there are no pages, the Page List block was showing an
unnecessary notice when it was a child of a Navigation block.

In order to more closely match the rendered front end and reduce
clutter, I instead added a placeholder so that users whose
intent is to have no pages can see a better representation
of their site.
@codesandbox
Copy link

codesandbox bot commented Nov 17, 2022

CodeSandbox logoCodeSandbox logo  Open in CodeSandbox Web Editor | VS Code | VS Code Insiders

@github-actions github-actions bot added the First-time Contributor Pull request opened by a first-time contributor to Gutenberg repository label Nov 17, 2022
@github-actions
Copy link

👋 Thanks for your first Pull Request and for helping build the future of Gutenberg and WordPress, @artemiomorales! In case you missed it, we'd love to have you join us in our Slack community, where we hold regularly weekly meetings open to anyone to coordinate with each other.

If you want to learn more about WordPress development in general, check out the Core Handbook full of helpful information.

@skorasaurus skorasaurus added the [Block] Page List Affects the Page List Block label Nov 20, 2022
@vidhan63-soe
Copy link

If you allow can i help?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Page List Affects the Page List Block First-time Contributor Pull request opened by a first-time contributor to Gutenberg repository
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants