This liblary allows you easeily use Bootstrap 3 breadcrumbs at you project. It supports translations and areas as well. You can manage your breadcrumbs from actions and put addiotional items to breadcumbs chain as well.
Here is a structure of breadcrumbs:
Each item in chain is the BreadcrumbsItem model which has these attributes:
Title - text ro display Area - area for this link Controller - controller for this link Action - action for this link RouteValues - additional parameters to be passed to link
###How to use:
- To install the liblary use NuGet console
$ Install-Package BootstrapBreadcrumbs.Core -Version 1.0.0
- Import taghelper to your **_ViewImports.cshtml ** file
@addTagHelper *, BootstrapBreadcrumbs.Core
- Add taghelper to your layout
<breadcrumbs-nav home-action="Index" home-controller="Home" home-title="Root"></breadcrumbs-nav>
All options can be setted using home- attribute.
- Add [Breadcrumbs] attribute to your controller to specify link for you controller breadcrumb item. You can set localization file with TitleSource property. In this case Title will be key for localization. You can manualy set controller breadcrumb using extention method for your controller like this
this.SetBreadcrumbController(breadcrumbItem)
- Add [Breadcrumbs] attribute to your action to specify action breadcrumb. You can set localization file with TitleSource property. In this case Title will be key for localization. You can manualy set it using extention method
this.SetBreadcrumbAction(breadcrumbItem)
- If you additionaly need prefix and sufix items use extention methods:
this.SetBreadcrumbPrefixItems(arrayOfBreadcrumbItems)
this.SetBreadcrumbSuffixItems(arrayOfBreadcrumbItems)
- Enjoy ;-)
You can download complexe sample here