Files
Umbraco-CMS/src/Umbraco.Web.UI.NetCore/Umbraco/PartialViewMacros/Templates/Navigation.cshtml

24 lines
724 B
Plaintext
Raw Normal View History

@using Umbraco.Core
2018-06-29 19:52:40 +02:00
@using Umbraco.Web
@inherits Umbraco.Web.Common.Macros.PartialViewMacroPage
2018-06-29 19:52:40 +02:00
@*
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(); }
2018-06-29 19:52:40 +02:00
@if (selection.Length > 0)
{
<ul>
@foreach (var item in selection)
{
<li class="@(item.IsAncestorOrSelf(Model.Content) ? "current" : null)">
2020-02-11 10:28:34 +01:00
<a href="@item.Url()">@item.Name</a>
2018-06-29 19:52:40 +02:00
</li>
}
</ul>
}