In the SortList section add a series of <Sort Name=name> nodes, one for each column displayed, where name is a descriptive name, recommended to correspond to the name of the column. Each <Sort Name=name> node contain at least one (or more) lines such as:
<SortDescription PropertyName="[objectClass.attributename]" IsAscending="true"/>
where objectClass is the class of the object, as defined in the base query.
The first listed sort is the one that is offered as the default sort when you display any directory within that base query.
In this example, there are four sort criteria, "Modified", "Name, "Length", "Folder" and "Workstate". The primary key of the sort Modified is "modifiedDate" of the folderObject and the secondary key is folder name. <SortList> <Sort Name="Modified"> <SortDescription PropertyName="[article.modifiedDate]" IsAscending="false" /> <SortDescription PropertyName="[article.name]" IsAscending="true" /> </Sort> <Sort Name="Name"> <SortDescription PropertyName="[article.name]" IsAscending="true" /> </Sort> <Sort Name="Length"> <SortDescription PropertyName="[article.bodyTextH]" IsAscending="true" /> </Sort> <Sort Name="Folder"> <SortDescription PropertyName="[article.folderRef.path]" IsAscending="true"/> <SortDescription PropertyName="[article.name]" IsAscending="true"/> </Sort> <Sort Name="Workstate"> <SortDescription PropertyName="[article.folderRef.workstateRef.name]" IsAscending="true"/> <SortDescription PropertyName="[article.name]" IsAscending="true"/> </Sort> </SortList> |
Sort names can be references in the ColStyle declarations within directory styles of the parent base query, such as: <ColStyle Name=”W” Width=”20” SortName=”Workstate” > Therefore, should you change the sort name, update all the references in the directory style. |
See also