Skip to content

Instantly share code, notes, and snippets.

@amirkhan81
Created September 10, 2020 19:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save amirkhan81/4d2df1b6d0719faae0c69584e24e3a01 to your computer and use it in GitHub Desktop.
Save amirkhan81/4d2df1b6d0719faae0c69584e24e3a01 to your computer and use it in GitHub Desktop.
@inherits Umbraco.Web.Macros.PartialViewMacroPage
@using Umbraco.Web
@{ var selection = Model.Content.Site().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>
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment