Files
Umbraco-CMS/src/Umbraco.Web.UI.NetCore/umbraco/PartialViewMacros/Templates/Navigation.cshtml
Bjarke Berg 1123b8bea5 Merge remote-tracking branch 'origin/netcore/netcore' into netcore/feature/better-linux-support
# Conflicts:
#	src/Umbraco.Web.UI.NetCore/umbraco/config/lang/en.xml
2020-08-11 08:33:11 +02:00

26 lines
923 B
Plaintext

@using Umbraco.Core
@using Umbraco.Core.Models.PublishedContent
@using Umbraco.Web.Routing
@inherits Umbraco.Web.Common.Macros.PartialViewMacroPage
@inject IPublishedValueFallback PublishedValueFallback
@inject IPublishedUrlProvider PublishedUrlProvider
@*
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(PublishedValueFallback)).ToArray(); }
@if (selection.Length > 0)
{
<ul>
@foreach (var item in selection)
{
<li class="@(item.IsAncestorOrSelf(Model.Content) ? "current" : null)">
<a href="@item.Url(PublishedUrlProvider)">@item.Name</a>
</li>
}
</ul>
}