Search code examples
kentico

Kentico repeater ORDER BY date


My page type as a date field 'Date', but i can't seem to get the repeater to display the items by Date.

My plan is to have a table with Date, Subject, and Author, and use a jquery plugin to sort by date.


Solution

  • EDIT: If you leave the DocumentTypes field blank (which means it will load all document types) then I believe the fields for those types aren't loaded into the properties for the CMSRepeater, so they will not be able to be ordered with ORDER BY or filtered with WHERE.


    If you'll open up your repeater webpart, you'll see a section called Content Filter. One of the settings in this filter is ORDER BY as seen here (v7 screenshot):

    enter image description here

    To filter by date, enter the name of the document type's field in this box (Make sure that field is of datetime type). For example:

    enter image description here

    You can also specify whether to sort by ascending (ASC) or descending order (DESC):

    enter image description here