Skip to content

2. Default Page

Haytam Zanid edited this page Apr 17, 2019 · 2 revisions

When using SmartBreadcrumbs, you must have a single default page annotated with DefaultBreadcrumb.
This will act as your default page and will always be rendered on the breadcrumbs (first item).

Razor Page

[DefaultBreadcrumb("My Home Page")]
public class IndexModel : PageModel
{
   ...
}

MVC Action

[DefaultBreadcrumb("My Home Page")]
public IActionResult Index()
{
   ...
}

MVC Controller

// The default action is "Index", it can be changed
// in the BreadcrumbOptions
[DefaultBreadcrumb("My Home Page")]
public class HomeController
{
    // ...
}
Clone this wiki locally