Problem/Motivation

Is there any way to limit easy breadcumbs to only show the last three parent menu items? For example, If I have a menu: blogs > 2020 > january > week1 > monday > dd/mm/yy. Can I make it show home>>january>>week1>>monday?

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

robpowell created an issue. See original summary.

greg boggs’s picture

The first thing I'd suggest is that you use shorter URLs for your site. However, if you want to add a "max depth" feature, that seems reasonable.

How would you choose which Breadcrumbs to remove?

greg boggs’s picture

you can use the crumb replacement feature to cover this as well if you don't want to patch easy breadcrumb.

kell.mcnaughton’s picture

Status: Active » Needs review
StatusFileSize
new3.23 KB

https://www.drupal.org/files/issues/2020-11-10/3174165-4.patch

I set up a patch that lets users limit the number of breadcrumbs.

greg boggs’s picture

Hi Kell,

Instead of implementing an alter hook, can you modify the builder plugin? So, the patch removes all breadcrumbs except the home crumb if it's over the limit? Is that right?

~G

greg boggs’s picture

It also looks like your config is needing the schema file addition. This is required for translation and testing.

damienmckenna’s picture

Status: Needs review » Needs work

That feedback makes complete sense, thank you Greg.

kell.mcnaughton’s picture

StatusFileSize
new3.93 KB

https://www.drupal.org/files/issues/2020-11-17/3174165-8.patch

I made the suggested tweaks and rolled a new patch.

greg boggs’s picture

Status: Needs work » Reviewed & tested by the community

Looks great. This will be in the next release! Thanks for the great feature.

~G

pattsai made their first commit to this issue’s fork.

  • kell.mcnaughton authored 6ea0204 on 8.x-1.x
    Issue #3174165 by kell.mcnaughton: How to support limiting depth
    
greg boggs’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.