RoverCore.BreadCrumbs
0.0.0-alpha.0
See the version list below for details.
dotnet add package RoverCore.BreadCrumbs --version 0.0.0-alpha.0
NuGet\Install-Package RoverCore.BreadCrumbs -Version 0.0.0-alpha.0
<PackageReference Include="RoverCore.BreadCrumbs" Version="0.0.0-alpha.0" />
paket add RoverCore.BreadCrumbs --version 0.0.0-alpha.0
#r "nuget: RoverCore.BreadCrumbs, 0.0.0-alpha.0"
// Install RoverCore.BreadCrumbs as a Cake Addin #addin nuget:?package=RoverCore.BreadCrumbs&version=0.0.0-alpha.0&prerelease // Install RoverCore.BreadCrumbs as a Cake Tool #tool nuget:?package=RoverCore.BreadCrumbs&version=0.0.0-alpha.0&prerelease
RoverCore BreadCrumbs
This small library provides a service that makes it easy to add and customize breadcrumbs. The idea is to allow you to create a simple list of breadcrumbs using this service that you can render using a component. What's nice about this approach is that you can add the entire breadcrumb trail in an MVC action method and include the component in your shared _layout.cshtml page.
Usage
Install
Install the package using NuGet
Install-Package RoverCore.BreadCrumbs
Initialize
After you have setup your breadcrumbs you must add the breadcrumbs service:
services.AddScoped<IBreadCrumbService, BreadCrumbService>();
Adding breadcrumbs
Include the IBreadCrumbService dependency service in your controller.
public class DashboardController : Controller
{
private readonly IBreadCrumbService _breadcrumbs;
public HomeController (IBreadCrumbService breadcrumbs)
{
_breadcrumbs = breadcrumbs;
}
public IActionResult Index()
{
_breadcrumbs.StartAtAction("Dashboard", "Index", "Dashboard", new { Area = "Admin"})
.Then("Home");
return View();
}
...
}
Overriding the default look
Create a directory in your project at the path Views/Shared/Components/BreadCrumbs (in your views/shared folder create a Components subdirectory and then a BreadCrumbs subdirectory). Copy the Views/Shared/Components/BreadCrumbs/Default.cshtml file from this project into that directory and customize how you wish.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
-
net6.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
1.0.3 | 839 | 1/28/2022 |
1.0.2 | 443 | 1/28/2022 |
1.0.0.1 | 453 | 1/20/2022 |
0.0.0-alpha.0 | 144 | 1/20/2022 |