Skip to content

Instantly share code, notes, and snippets.

@warrenbuckley
Created February 28, 2012 16:48
Show Gist options
  • Select an option

  • Save warrenbuckley/1933587 to your computer and use it in GitHub Desktop.

Select an option

Save warrenbuckley/1933587 to your computer and use it in GitHub Desktop.
Umbraco V5 Example - [MODEL] Loop Children ordered by Name
//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