Files
2016-11-07 12:56:17 -05:00

22 lines
518 B
Plaintext

@inherits umbraco.MacroEngines.DynamicNodeContext
@*
Macro to display child pages below the root page of a standard website.
Also highlights the current active page/section in the navigation with
the css class "current".
*@
@{
@* Get the root of the website *@
var root = Model.AncestorOrSelf(1);
}
<ul>
@foreach (var page in root.Children.Where("Visible"))
{
<li class="@page.IsAncestorOrSelf(Model, "current", "")">
<a href="@page.Url">@page.Name</a>
</li>
}
</ul>