Created
April 24, 2018 08:44
-
-
Save hartviglarsen/076725d3749aaaff3912c63d23dc8490 to your computer and use it in GitHub Desktop.
Umbraco breadcrumbs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@inherits Umbraco.Web.Mvc.UmbracoTemplatePage | |
@using ContentModels = Umbraco.Web.PublishedContentModels; | |
@{ | |
Layout = null; | |
var crumbs = Model.Content | |
.Ancestors() | |
.Where(x => x.IsVisible()) | |
.OrderBy("Level"); | |
} | |
<div class="breadcrumbs"> | |
@foreach (var crumb in crumbs) { | |
<a href="@crumb.Url">@crumb.Name</a> | |
<span>></span> | |
} | |
<a href="@Model.Content.Url">@Model.Content.Name</a> | |
</div> | |
@RenderBody() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment