sort tree nodes by custom field

BORAH LEE asked on March 1, 2016 00:31

Hi. Is there any way to sort tree node by a specific field of the page type? I can see the right-click menu called 'Sort subsection...' on the items on page application but the order options are only alphabetically or modified date. I need to order nodes by a field of the page (ex. event date).

Thank.

Recent Answers


Trevor Fayas answered on March 1, 2016 01:15

Extending the Kentico UI field may be a bit out of reach for most, but you can create a Module and add a custom custom ASCX control that has either just a textbox (you can use Kentico's CMS:FormControl to use one of Kentico's URL selectors) and a button that will take a page and go through it's children and order them.

Once you have the child documents, sorted by Event Date, then you can update the NodeOrder of each, or if you wanted use the CMS.DocumentEngine.TreeProvider.MoveNodeDown / MoveNodeUp.

However, other than for how it looks on the page, if you just need to sort events on the actual page, you should do that through the "Order By" Statement (EventDate Desc) on the repeaters.

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.