Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
I'm trying to sort node with this code:
CurrentPage.Children.Where("Visible").OrderBy("sortOrder")
but is seems not working with sortOrder, is OK with other value (Id, Name, ecc)
Anyone can help me ?
hi Luca,
By default the Umbraco API will return the children of a item in the sortorder set in the backend. So you don't need to do this sorting yourself.
You only need to do sorting yourself when you want to sort on other properties like Name, Date, etc..
Dave
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
OrderBy("sortOrder") not working
I'm trying to sort node with this code:
CurrentPage.Children.Where("Visible").OrderBy("sortOrder")
but is seems not working with sortOrder, is OK with other value (Id, Name, ecc)
Anyone can help me ?
hi Luca,
By default the Umbraco API will return the children of a item in the sortorder set in the backend. So you don't need to do this sorting yourself.
You only need to do sorting yourself when you want to sort on other properties like Name, Date, etc..
Dave
is working on a reply...