Umbraco 8 OrderBy a collection by a Custom Field Such as a Date
This is a snippet for Umbraco 8 to Order a collection by a Custom Field Such as a Date. @{ var selection = Umbraco.Content(Model.Id) .ChildrenOfType("publication") .Where(x => x.IsVisible()) .OrderBy( x => x.Value("publicationDate")); } @foreach (var item in selection.Take(1)) { <h2><a href="@item.Url" title="@item.Name">@item.Name</a></h2> }