When using .BindToLocation(true) it would be great if the developer had either a .Skip(string) or .Skip(string array) (or .Exclude(string) or .Exclude(string array).
This is useful because in ASP.NET Core when using Razor Pages, the site can be organized into Folders. That Folder structure shows up in the URL even though there might not be an equivalent page.
As an Example, I have the following folder structure:
Pages --> Alerts --> AlertAvailableUnits
The resulting URL in ASP.NET Core is:
Now, let's say I have the following Breadcrumb definition:
@(Html.Kendo().Breadcrumb() .Name("breadcrumb") .BindToLocation(true) .Navigational(true))
This results in the following Breadcrumb:
Home > Alerts > AlertAvailableUnits
However...if I had an Exclude or Skip function then I could create the following definition:
@(Html.Kendo().Breadcrumb() .Name("breadcrumb") .BindToLocation(true) .Navigational(true) .Skip("Alerts")) // OR As a String Array @(Html.Kendo().Breadcrumb() .Name("breadcrumb") .BindToLocation(true) .Navigational(true) .Exclude(["Alerts"])
This would result in the following Breadcrumb:
Home > AlertAvailableUnits
This is what I'm after. Since BindingToLocation has to parse the URL anyway to produce the Breadcrumb, then the Developer should have a way to Exclude or tell it to ignore/skip a part of the URL.
This would be complementary to my previously requested Breadcrumb Feature .IgnoreLastXSegments(integer).
The difference between the two is -- in the .Exclude/Skip case the segment I want to ignore is Known and occurs (usually) in the middle of the URL. In the IgnoreLastXSegments, the URL contains parameters that always show up at the end.
Implementing these Features would make the BindingToLocation feature much more useful and promotes code reuse. It is also a much simpler implementation than defining Items which does not promote code reuse.
Thanks for your consideration.
On the new Breadcrumb, I would like to see an .IgnoreLastXSegments(n) property in the .NET Core Fluent API that is used when .BindingToLocation(true)
Imagine the following URL:
In the current Breadcrumb with BindToLocation(true) this becomes
Home > Person > Edit > 1234 (1234 is not clickable)
If I add the Property .IgnoreLastXSegments(1) then the breadcrumb would render
Home > Person > Edit (Edit is not clickable)
The second example (IgnoreLastXSegments) is what you would really want when binding to the current location url.
The breadcrumb should do this out of the box. By making it an integer (defaulted to 0), then I have control on a page depending upon the number of segments that are passed as parameters.
Thank you for the consideration.