Files
LeafWeb/WebCms/Umbraco/PartialViewMacros/Templates/ListChildPagesFromCurrentPage.cshtml
T
2018-09-16 15:08:47 -04:00

25 lines
605 B
Plaintext

@using Umbraco.Web
@inherits Umbraco.Web.Macros.PartialViewMacroPage
@*
This snippet makes a list of links to the of children of the current page using an unordered HTML list.
How it works:
- It uses the Children method to get all child pages
- It then generates links so the visitor can go to each page
*@
@{ var selection = Model.Content.Children.Where(x => x.IsVisible()).ToArray(); }
@if (selection.Length > 0)
{
<ul>
@foreach (var item in selection)
{
<li>
<a href="@item.Url">@item.Name</a>
</li>
}
</ul>
}