Problem/Motivation
It is sometimes desired to only show breadcrumbs when they contain more that 1 segment. This is typically for sites where you do not include the Home link as part of the breadcrumb, and you want the current page title to be part of the trail but only when a parent link exists.
This was previously raised in https://www.drupal.org/project/easy_breadcrumb/issues/2908189 but the solution was limited just to the scenario where you do include the home link in the trail.
Proposed resolution
This could be implemented as minimum count given there is already the functionality to set a maximum number of segments.
| Comment | File | Size | Author |
|---|---|---|---|
| #7 | Screenshot 2024-04-05 at 14-43-37 Easy Breadcrumb Drush Site-Install.png | 22.4 KB | ericgsmith |
Issue fork easy_breadcrumb-3309109
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
Comment #3
ericgsmith commentedComment #4
ericgsmith commentedComment #5
greg boggsAwesome feature.
Need a reroll, and lets remove the update hook so folks config doesn't change on them. If folks want to use the feature after they update, they can check the box and when new folks install, they'll get the feature checked by default. This way we aren't changing people's crumbs on update.
Comment #6
ericgsmith commentedComment #7
ericgsmith commentedApologies for taking over a year to respond - I appreciate the review and the feedback.
Coming back to this after a year - the intent of setting the config to 1 is to maintain existing functionality. I believe its good practice to make sure newly introduced config includes an update to set the default value, otherwise we can make the schema nullable. Setting the value to 1 is not changing any existing behaviour.
I do find the UI confusing - and I think when you say "can check the box" when they install, that it looks like the other settings on the form are related / have control over this. That is my mistake for positioning the field next to that - I didn't really look close enough at the existing behaviour of that option first. That "Limit breadcrumb trail segments" is from #3174165: How to support limiting depth and to be honest I'm still a bit confused by it - because I think the wording of the label and the functionality is a bit different 😅 But, I don't want to confuse this feature request with that functionality - I think it will be clearer if I make the UI clearer what this field does.
Perhaps it would be better to move this new field down into the Advanced settings - I prefer the UX of the form fields there that are enabled by a checkbox and then have the field value only shown when checked. I could refactor it so its like this:
I think that wording makes it a bit clearer too?
(Values in the screenshot just an example of how I'm using it - not suggesting we default to 2)
Comment #8
greg boggsok got it! Sounds like we can include this as is.
Comment #10
greg boggsComment #11
ericgsmith commentedAh thanks @Greg - I just pushed with the suggested change - all good if we don't need it - thanks for the review!