Skip to content

New Breadcrumbs Block #21943

Closed
Closed

Description

@paaljoachim

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.
Screen Shot 2020-05-02 at 11 13 41

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

Screen Shot 2020-04-28 at 13 05 52

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.)

Activity

  1. added
    New Block
    on Apr 28, 2020
  2. added
    Needs Design Feedback
    on Apr 28, 2020
  3. karmatosed commented on May 1, 2020

    @karmatosed
    Member

    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?

  4. sybrew commented on May 16, 2020

    @sybrew

    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

    A breadcrumb is a row of internal links at the top or bottom of the page that allows visitors to quickly navigate back to a previous section or the root page. Many breadcrumbs have the most general page (usually the root page) as the first, leftmost link and list the more specific sections out to the right. We recommend using breadcrumb structured data markup when showing breadcrumbs.

    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.

  5. aristath commented on Aug 14, 2020

    @aristath
    Member

    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!

    • On the editor side:
      • If used inside a template it would basically need to be a plain placeholder, since the actual breadcrumb will depend on the post the template is used on.
      • If used on a single post/page (basically anything other than a template or template-part), we could provide the option to customize the path. It would be nice, but not necessary for the initial implementation.
    • On the front side:
      • Minimal styles would have to be implemented. Nothing fancy, just a display:flex on its wrapper, and separators between the items.

    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.

  6. paaljoachim commented on Jul 6, 2021

    @paaljoachim
    ContributorAuthor

    @andrewserong Andrew has made a WIP/Draft PR here: #32500
    I noticed the progress has stopped up.

  7. andrewserong commented on Jul 7, 2021

    @andrewserong
    Contributor

    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!

  8. added
    [Status] In Progress
    on Jul 8, 2021
  9. paaljoachim commented on Aug 17, 2021

    @paaljoachim
    ContributorAuthor

    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.

  10. self-assigned this
    on Sep 17, 2021
  11. linked a pull request that will close this issueNew block: Add a Breadcrumbs block #32500on Oct 14, 2021
  12. BrunoAHVincent commented on Aug 25, 2022

    @BrunoAHVincent

    Any solution to this yet?

  13. paaljoachim commented on Aug 25, 2022

    @paaljoachim
    ContributorAuthor

    Hopefully @andrewserong will bet able to get the first version in place by 20th September (beta 1).

  14. andrewserong commented on Aug 25, 2022

    @andrewserong
    Contributor

    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!

  15. 2 remaining items

  16. added
    [Type] Enhancement
    on Aug 24, 2023
  17. rodolfomartinez commented on Nov 28, 2023

    @rodolfomartinez

    Massive +1 here. With the recent advances in SEO and Accessibility in WordPress, I am surprised that we don't have this.

  18. justintadlock commented on Nov 28, 2023

    @justintadlock
    Contributor

    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.

    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.

  19. paaljoachim commented on Jan 27, 2024

    @paaljoachim
    ContributorAuthor

    Breadcrumbs was brought up in the FSE Outreach Experiment Slack channel.
    https://wordpress.slack.com/archives/C015GUFFC00/p1705592363506389

    With this question by Alex.
    "Although I am still diving into the recently released updates, I was curious about the projected timeline for incorporating Breadcrumbs functionality. As a theme developer, integrating ready-made Breadcrumbs patterns would be exceptionally beneficial and aligns with one of the most frequent header-related requests we receive."

    I want to add @andrewserong 's comment he made to the Slack thread.
    "I’d love to see us get a Breadcrumbs block into core. It’s been tricky to figure out the desired scope for a minimal block in core that still does everything that everyone would like it to. In my old WIP PR we didn’t manage to come to a consensus about whether or not the core block should include the schema.org microdata. It’d certainly be worth revisiting the idea, though, and seeing which features make sense for core, and which are better left to plugins."

    It would be very helpful to get some movement here. Let's get to a consensus about the next step.
    Thank you!

  20. jarekmorawski commented on Jun 19, 2024

    @jarekmorawski
    Contributor

    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).

    Block

    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.

    Layout

    The same settings would also be available in the Inspector. There'd be a new option for Width to allow users to enter a custom width in pixels or other units.

    Width

    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., Home or Store.

    Home

    Users could click the ellipsis menu to access more settings, like the current page toggle and a navigation level slider.

    More

    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 Color in the Style tab.

    Current page

    The Max. navigation level slider would let users decide when breadcrumbs should be truncated. If moved to the left, the block would display ... in place of the truncated links. Note that the slider would define the maximum number of levels to show, so if there are fewer links, we'd show them all.

    Max levels

    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.

    Separator

    Once again, users could change the separator color in the Color section.

    Color

    Let me know if you have any thoughts!

  21. LukaszJaro commented on Aug 3, 2024

    @LukaszJaro

    Was there any more discussion about the adding some structured data to the breadcrumbs via microdata(schema.org)?

  22. justintadlock commented on Aug 9, 2024

    @justintadlock
    Contributor

    The Max. navigation level slider would let users decide when breadcrumbs should be truncated. If moved to the left, the block would display ... in place of the truncated links. Note that the slider would define the maximum number of levels to show, so if there are fewer links, we'd show them all.

    Is there a "no max" option here in the slider, which should be the default?

    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.

    Just noting that this list should be filterable by theme/plugin authors and the default separator should be something that can be set via theme.json.

    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.

    After 15 years of maintaining a breadcrumbs plugin, I've never once had someone ask to add a leading separator.

    Once again, users could change the separator color in the Color section.

    I'm not a big fan of adding non-standard colors to block options because theme authors cannot control them via theme.json at the moment. I'd avoid extra color options, at least until Core supports this.

  23. jarekmorawski commented on Aug 12, 2024

    @jarekmorawski
    Contributor

    Is there a "no max" option here in the slider, which should be the default?

    Moving the slider all the way to the right would show all levels, no matter how many are there.

    Just noting that this list should be filterable by theme/plugin authors and the default separator should be something that can be set via theme.json.

    I agree. Every style-specific setting in the block should be extendable and modifiable by themes. We should, however, offer some options out of the box for users who use the default theme or one that doesn't provide extra customization settings.

    After 15 years of maintaining a breadcrumbs plugin, I've never once had someone ask to add a leading separator.

    Me neither, but it exists in the current block, so I've kept it for backward compatibility. I wouldn't mind removing it to reduce complexity.

    I'm not a big fan of adding non-standard colors to block options because theme authors cannot control them via theme.json at the moment. I'd avoid extra color options, at least until Core supports this.

    I think we'll need that anyway because well-defined active vs. inactive link styles are crucial for breadcrumbs. As for the separator, perhaps we'd automatically associate its color with the text color and display a slider to change its opacity, similar to the overlay in the Cover block?

    image
  24. TheJeffr0 commented on Jan 31, 2025

    @TheJeffr0

    Would love to see a Breadcrumbs block added to core like the following https://designsystem.digital.gov/components/breadcrumb/

  25. unscripted commented on Sep 2, 2025

    @unscripted
    Member

    I'm excited to see this on the list for the #71026. I know a lot of work was put into #32500, but it appears that it may need some larger changes to bring it up to date with core. If that is the case, I would like to nominate @justintadlock's X3P0: Breadcrumbs as a solid addition for the core block's basic functionality.

    There are things I would love to include, like the ability to overwrite a specific title's output, but this could be resolved by adding filters in the future.

  26. removed their assignment
    on Sep 25, 2025
  27. westonruter commented on Oct 7, 2025

    @westonruter
    Member

    I've added a post-merge review of the PHP for some things I think need to be addressed: #71793 (review)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Needs Design FeedbackNew Block[Feature] Site Editor[Status] In Progress[Type] Enhancement

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions