Created
February 28, 2012 16:48
-
-
Save warrenbuckley/1933587 to your computer and use it in GitHub Desktop.
Umbraco V5 Example - [MODEL] Loop Children ordered by Name
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
//Order by Node Name | |
@foreach (Content child in Model.ChildContent().OrderBy(x => x.Name)) | |
{ | |
<h2>@child.Name</h2> | |
} | |
//Order by custom property on node with alias of 'pageTitle' | |
@foreach (Content child in Model.ChildContent().OrderBy(x => x.Field("pageTitle"))) | |
{ | |
<h2>@child.Name</h2> | |
<h4>@child.Field("pageTitle")</h4> | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment