-
-
Save perploug/1957553 to your computer and use it in GitHub Desktop.
List Child pages from site root (1st level)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@inherits PartialViewMacroPage | |
@using Umbraco.Cms.Web | |
@using Umbraco.Cms.Web.Macros | |
@using Umbraco.Framework | |
@{ | |
//declare variables | |
var rootNode = DynamicModel.AncestorsOrSelf.Last(); | |
} | |
@if(rootNode.Children.Any()) | |
{ | |
<ul> | |
@foreach(var childPage in rootNode.Children) | |
{ | |
<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