-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Blocks: Add Breadcrumbs block #71793
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
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 Unlinked AccountsThe following contributors have not linked their GitHub and WordPress.org accounts: @BrunoAHVincent, @rodolfomartinez. Contributors, please read how to link your accounts to ensure your work is properly credited in WordPress releases. 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. |
|
Size Change: +1.17 kB (+0.06%) Total Size: 1.96 MB
ℹ️ View Unchanged
|
|
Flaky tests detected in e977d63. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/18271342506
|
b6890a4 to
bed0a63
Compare
This behavior is tricky and added a filter here, similar to what we do for template parts, post content etc.. In general it's still not working exactly as you had in mind, because if we also show the template, the block can be inserted. I'm not sure we should try to fine tune this as much as we can (like checking specific templates etc..) because it might get out of hand trying to add various conditionals. We have the same issue with many blocks right now (ex. Archive Title, Term description and many more) and if we want to find a good solution for such context detection we should explore a way to cover all blocks. I'd even argue that this block might not even need special care, but maybe it's fine due to its name (
The other thing that is quite fragile is the placeholder, which I added in my last commit. This block is server side rendered and we try to have a placeholder in the editor that matches that. This means that if we change the server side output and not update the I'd love some more thoughts about this. Maybe @Mamaduka or @youknowriad?
That would be awesome, thank you! |
I think it's ok to have a placeholder when there's no context that tries to mimick the output. |
+1. A general placeholder should be fine when there's no context. There's not much we can do in those scenarios. |
bed0a63 to
866313c
Compare
Co-authored-by: Aki Hamano <[email protected]>
This reverts commit 6ec5a07.
4eb7739 to
fb2d9f0
Compare
|
Since the plan is to support breadcrumbs for multiple types(post, terms, archive, etc..) I renamed the block to just What do you think of merging and quickly following up with more functionality, starting with terms? |
t-hamano
left a comment
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.
As v1, we think it's robust, minimal, and ready to ship.
We can add the "terms" behavior as a follow-up which would force us to think about how to differentiate between "auto" and "manual" behavior. I think we need a "help" text in the sidebar explaining what the block does in "auto" behavior.
Let's carefully consider this in a follow-up.
P.S. Once the Gutenberg_Hierarchical_Sort class is backported to core, we might be able to refactor the Edit component to use client-side rendering. See:
|
@bgardner - The current version only works for singular post views of hierarchical post types. |
|
@bgardner it's what @justintadlock said. I'll open a follow up to support more cases and start with |
|
@justintadlock Singular being different than Single? |
"Singular" covers more use cases than "single" (for example, Honestly, it'd be more appropriate to say that the current version is tied to a post context and only when that post type is hierarchical. It's not really checking if we're on a single or singular view. Regardless, it basically only works for Pages and hierarchical post types at the moment. |
|
@justintadlock Completely understand. Just wanted to confirm that what I posted above is expected behavior (and not a bug). Which it appears to be (expected). Appreciate it! |
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.
Post-merge review of the PHP code.
|
Edit: I meant to add this comment in #72124. I'll add it there. |











What?
Part of: #71026
Resolves: #21943
This PR adds a simple breadcrumbs block that has two options:
Tasks:
Testing Instructions
pages)Screenshots or screencast