Created
March 2, 2012 13:52
-
-
Save warrenbuckley/1958517 to your computer and use it in GitHub Desktop.
List ChildPages Ordered By Date Created (Desc)
This file contains 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 | |
@* Ensure that the Current Page 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, order in descending order by date created *@ | |
@foreach (var childPage in DynamicModel.Children.Where("umbracoNaviHide != @0", "True").OrderByDescending("UtcCreated")) | |
{ | |
<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