-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Breadcrumbs: Add archives support #72478
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 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: -122 B (-0.01%) Total Size: 2.27 MB
ℹ️ View Unchanged
|
|
Looks good at a quick glance. I think it's the segmented control we need a tweak to. "With ancestors" doesn't read clearly. How about something like: Page path (for anything hierarchical), with this contextual help text:
Archive path (for terms, authors, cpts, anything non hierarchical) with contextual help:
|
The tricky part with this control is that is very specific to the case where we have That's why I think there should be a single So, @jasmussen your suggested copy is not accurate because nothing else is impacted by the value of this attribute, like I even considered not having a UI for this, but some PHP filter that will probably be needed for some other specific more advanced settings, like selecting main taxonomy and term per post type. I plan to explore this after landing this one. |
|
Thanks for the clarification. I still think there's a way to provide more easily understood terminology for these. I realize it may be an exotic feature, but it seems like it should be possible to use simpler language. We can be verbose. I wonder, who can we ping with good instincts for what might be good verbiage here? Pinging at random, perhaps @mcsf ? |
Not for Woo. It's general handling for all post types, which would first run through the Then it'd run through the |
a6a4d3d to
b43c5c6
Compare
|
@justintadlock do you think we can move forward with this iteration? Is there something in your opinion that should be handled better here? There will be follow ups and I don't want to add too many things at once. |
|
Flaky tests detected in 4bd4ac0. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/18786465105
|
|
It took me a while to wrap my head around this. Here's my takeaway: @ntsekouras's proposed messaging is on the right track, but our choice of type of control and form layout could make a big difference. I agree with @jasmussen that the "With ancestors" / "With terms" labelling is confusing. Ultimately, isn't this setting an advanced setting that most users don't have to be bothered with (until they do)? With that in mind, I'm thinking we should frame this as an option, possibly with a checkbox: Yeah, it's still a mouthful. Balancing clarity and accuracy is tricky here. Hence the motivation to demote this setting to an opt-in preference that most users can ignore, and hence the suggestion to consider making it an advanced setting. Is this helpful at all? |
It should be fine to move forward. I also think it'd be helpful to have a general/tracking ticket for the block itself to discuss items like what @mcsf mentioned above, which are not necessarily directly related to to the addition of archives support. We don't want to lose track of good feedback and architectural discussion. |
b43c5c6 to
b5a0fe6
Compare
|
I created an initial tracking issue for the block here.
@mcsf of course it is. I updated per your suggestion with the difference that the help message in controls is below and I think we shouldn't be blocked much by this here, as it should be handled and designed better with the rest similar settings. I have this as a task in the tracking issue:
|
|
I like that verbose description, and making it a checkbox. It's completely fine to be extremely elaborate and clear in contexts like these, where you have already found your way to the block itself and are choosing to configure arcana. |
mcsf
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.
Looks good! Left some notes to polish first.
b5a0fe6 to
b4829fc
Compare
f42f136 to
4bd4ac0
Compare
What?
Part of: #72498
This PR adds
archivessupport for Breadcrumbs block.The goal for this block is to be used in possibly a single page (for example header of the site) and work seamlessly in any page. I've tried to think of any use case where the breadcrumb trail could should alternative trails based on any condition but couldn't, besides the case of hierarchical post types with taxonomies (`postWithAncestors|postWithTerms).
For the above reasons it doesn't make any sense to keep the
type:autoflag, as we're going to handle this internally. We just need a specific block setting to just handle the user's preference in that case (hierarchical post types with taxonomies ), which also has a default value to show the ancestors.For this PR, I don't believe the position of control matters much, but in a follow up we'll also add whether to show the breadcrumbs in the

home page. Both of these settings aretemplatespecific logic, which can be even grouped in a separatepanel.Testing Instructions
Breadcrumbsblock in various contexts (pages, templates, etc..)Headerof the site and visit different pages/categories, etc..Screenshots or screencast
Below I'm sharing some screenshots in a site that I've added @justintadlock's plugin and the core block in the main header.
Above is
x3p0-breadcrumbs/and below is thecore block.Date archive (identical)
Author archive (identical)
Custom CPT archive (identical)
Tag archives (identical)
Custom taxonomy (identical)
Woo category
Justin's block also shows the

products archive- is this special handling for Woo @justintadlock ? 🤔Nested post categories (2 levels)
Nested post categories (3 levels)
Core block displays all nested levels.

Custom CPT with terms assigned
Core shows the term link and Justin's block the CPT archive.

Custom CPT without terms assigned
Justin's block shows the CPT archive link.
