Skip to content

dantey89/BootstrapBreadcrumbs.Core

Repository files navigation

Bootstrap 3 Breadcrumbs for Asp.Net Core 2

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:

Breadcrumbs structure

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:

  1. To install the liblary use NuGet console

$ Install-Package BootstrapBreadcrumbs.Core -Version 1.0.0

  1. Import taghelper to your **_ViewImports.cshtml ** file
    @addTagHelper *, BootstrapBreadcrumbs.Core
  2. 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.

  1. 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)

  1. 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)

  1. If you additionaly need prefix and sufix items use extention methods:

this.SetBreadcrumbPrefixItems(arrayOfBreadcrumbItems) this.SetBreadcrumbSuffixItems(arrayOfBreadcrumbItems)

  1. Enjoy ;-)

You can download complexe sample here

About

Bootstrap Breadcrumbs for Asp.Net Core projects

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published