Skip to content

Instantly share code, notes, and snippets.

@arjanwoldring
Forked from warrenbuckley/gist:1957689
Created March 19, 2012 21:46
Show Gist options
  • Save arjanwoldring/2127367 to your computer and use it in GitHub Desktop.
Save arjanwoldring/2127367 to your computer and use it in GitHub Desktop.
List Child Nodes from CurrentPage
@inherits PartialViewMacroPage
@using Umbraco.Cms.Web
@using Umbraco.Cms.Web.Macros
@using Umbraco.Framework
@* Ensure that the rootNode has children, where the property umbracoNaviHide is not True *@
@if(DynamicModel.Children.Where("umbracoNaviHide != @0", "True").Any())
{
<ul>
@* For each child page under the root node, where the property umbracoNaviHide is not True *@
@foreach (var childPage in DynamicModel.Children.Where("umbracoNaviHide != @0", "True"))
{
<li>
<a href="@childPage.Url">@childPage.Name</a>
</li>
}
</ul>
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment