-
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
New Breadcrumbs Block #21943
Comments
I like the idea of this block. I don't think it needs too many options. I am not sure about renaming or linking, that feels like heading into the territory of navigation for me, which there is already a block for. However, would you be able to tell me more what you were thinking there @paaljoachim? |
Breadcrumbs are fundamental to any website with more than one page, where they help visitors traverse pages easily. In essence, they must contain links all the way back to the homepage. From Google: https://support.google.com/webmasters/answer/7451184?hl=en#hierarchy
It'd be great to have this a block in Gutenberg/Core, as it'll push Phase 2's "Full Site editing" further towards completion. |
Adding some thoughts here: A breadcrumbs block will definitely be one the things that will be necessary for FSE... Breadcrumbs is one of the most basic things any theme adds, and it's always one of the messiest things to get right. Providing authors & users with a robust & clean solution would go a long way!
The block will need to be dynamic and not save the actual breadcrumbs HTML/path. Taxonomy hierarchies change, post categories & tags change, even the slugs can change. With that in mind, the breadcrumbs will need to be generated on post-render. As for how the breadcrumbs themselves will be generated, there are lots of implementations out there. One of the most robust I've seen so far is the one in hybrid-breadcrumbs by @justintadlock, or the implementation from Yoast SEO. We could probably extract some of the logic from that and work on abstracting it, clean it up and remove the things that won't be necessary in the context of a block, strip it to its basics and make it into a block that can be used consistently. |
@andrewserong Andrew has made a WIP/Draft PR here: #32500 |
Thanks for the ping @paaljoachim! I had a bit of time a few weeks ago to explore the WIP draft PR, but then switched over to working on some other projects. I'm hoping to get back to it later on this week, and then chip away on it a bit in my spare time. If anyone gets the chance to take the PR for a spin / try it out, I'm very happy for feedback on the approach! |
I left some feedback directly in the PR. It would be helpful if others can also test out the Draft PR One can use the Gutenberg PR build approach to test out the PR. Outlined here. |
Any solution to this yet? |
Hopefully @andrewserong will bet able to get the first version in place by 20th September (beta 1). |
Thanks for the ping! Yes, the draft is still in #32500 — it's a little lower in the priorities currently than design tooling consistency (#43241), which I've been helping out with (particularly spacing support #43243 and reviews), so not sure yet if I'll get enough time to dust it off before the beta cutoff. Will see how I go! |
I got a similar request from a client recently. +1. |
Massive +1 here. With the recent advances in SEO and Accessibility in WordPress, I am surprised that we don't have this. |
I've also made that original script into a block on in the plugin directory (GitHub link), so feel free to use anything from the newer code for a core block too. It'd definitely be a tough addition to core if we want something robust enough to handle any scenario. Most likely, we'd want to cover some base use cases and make it filterable enough for plugins to extend. |
Breadcrumbs was brought up in the FSE Outreach Experiment Slack channel. With this question by Alex. I want to add @andrewserong 's comment he made to the Slack thread. It would be very helpful to get some movement here. Let's get to a consensus about the next step. |
Interesting discussion! There's a clear interest in a Breadcrumbs block. I'm not sure it should be part of the core suite, but there's a chance it could be added when someone browses patterns or blocks in the Inserter (related: #61504). After some internal discussion, I put together a design that I hope balances customizability and simplicity. It's based on @andrewserong's PR (#32500). I imagine the block would be extensible, meaning third parties could add custom settings and options (like icons or a new toggle to display the home link as an icon). The block would consist of links to pages, navigation levels, taxonomies, etc. Using the toolbar, users could set the justification, alignment, and width—same as with the Group block and its variants. The same settings would also be available in the Inspector. There'd be a new option for Users would go to Inspector to customize the block's appearance and behavior. When they enable "Show home link", the block will display a link to the home page and users will see an input field in the Inspector. It will allow them to customize the name of the home link. It'd default to the site name but users could enter anything, e.g., Users could click the ellipsis menu to access more settings, like the current page toggle and a navigation level slider. When the current page toggle is on, the block will display the name of the currently viewed page as the last breadcrumb level. It will not be active, so it wouldn't have the underline like other breadcrumbs. Users could change its appearance under The Users could change the separator in the Styles tab. Of all the dozens of websites I checked, all used one of the three options I included in the design. It could be a good starting point and if users ever need something else, they'd install a plugin that extends the block. I also included a toggle for displaying the leading separator and reworded the copy a bit, though I'd argue the pattern isn't common enough to be part of the block's default setup. Happy to keep it in the design if you feel it's valuable. Once again, users could change the separator color in the Color section. Let me know if you have any thoughts! |
Was there any more discussion about the adding some structured data to the breadcrumbs via microdata(schema.org)? |
Is there a "no max" option here in the slider, which should be the default?
Just noting that this list should be filterable by theme/plugin authors and the default separator should be something that can be set via
After 15 years of maintaining a breadcrumbs plugin, I've never once had someone ask to add a leading separator.
I'm not a big fan of adding non-standard colors to block options because theme authors cannot control them via |
It would be nice to have a breadcrumbs block that we can add to the any area of the content.
EDIT:
I am cleaning up the proposal.
Here is a screenshot that uses the paragraph block to exemplify breadcrumbs.
One could add a breadcrumbs block to a post/page template, and style it directly in the template, and/or the block could become a dynamic reusable block.
Some styling options could be font color, font size, background color, icon between each level and width(if the breadcrumbs block is to stretch all the way across the post/page). Showing the path hierarchy with page/post title names.
This would be one of the Full Site Editing blocks which would be dynamic in nature, showing the relevant information based on the page/post one is currently on.
Initial post:
Here is an example from @aristath 's Gridd theme: https://github.com/wplemon/gridd
Here we need to be able to change the text and background color.
Rename/relink breadcrumbs in relation to @karmatosed 's below question. (Reason why I mentioned renaming is that some sites will automatically add a title called Home to the front page. It would be good to have the home page name used instead of the name Home.)
The text was updated successfully, but these errors were encountered: