Unplanned
Last Updated: 31 Jan 2020 15:25 by ADMIN
Dennis
Created on: 26 Jan 2020 17:12
Category: Breadcrumb
Type: Feature Request
4
Breadcrumb - Skip or Exclude Functionality when Binding To Location

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:

https://localhost:44313/Alerts/AlertAvailableUnits 

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.

1 comment
ADMIN
Dimitar
Posted on: 30 Jan 2020 08:36

Hello Dennis,

Thank you for submitting this feature request.

Marking it as approved, as this would be indeed a useful enhancement to the bindToLocation option - this could become a composite option that has an additional skip: x property.

I have update your Telerik Points for submitting this request and helping us improve the product.

Regards,
Dimitar
Progress Telerik

Get quickly onboarded and successful with Telerik UI for ASP.NET Core with the dedicated Virtual Classroom technical training, available to all active customers.