Skip to content

Instantly share code, notes, and snippets.

@carlosmartinezt
Created April 23, 2014 15:49
Show Gist options
  • Save carlosmartinezt/11220816 to your computer and use it in GitHub Desktop.
Save carlosmartinezt/11220816 to your computer and use it in GitHub Desktop.
@if (Model.Content.Ancestors().Any())
{
<div class="breadcrumb">
<ul class="none">
@* For each page in the ancestors collection which have been ordered by Level (so we start with the highest top node first) *@
@foreach (var page in Model.Content.Ancestors().OrderBy("Level"))
{
<li><a href="@page.Url">@page.Name</a></li>
}
@* Display the current page as the last item in the list *@
<li class="active">
@Model.Content.Name
</li>
</ul>
</div>
}
@MangirishWagle
Copy link

Thanks very much, Carlos. It worked!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment