Files
Umbraco-CMS/src/Umbraco.Web.UI.NetCore/Umbraco/PartialViewMacros/Templates/Navigation.cshtml
Bjarke Berg 1594a84d80 migated remaining backoffice controllers
Signed-off-by: Bjarke Berg <mail@bergmania.dk>
2020-06-22 10:08:08 +02:00

24 lines
724 B
Plaintext

@using Umbraco.Core
@using Umbraco.Web
@inherits Umbraco.Web.Common.Macros.PartialViewMacroPage
@*
This snippet displays a list of links of the pages immediately under the top-most page in the content tree.
This is the home page for a standard website.
It also highlights the current active page/section in the navigation with the CSS class "current".
*@
@{ var selection = Model.Content.Root().Children.Where(x => x.IsVisible()).ToArray(); }
@if (selection.Length > 0)
{
<ul>
@foreach (var item in selection)
{
<li class="@(item.IsAncestorOrSelf(Model.Content) ? "current" : null)">
<a href="@item.Url()">@item.Name</a>
</li>
}
</ul>
}