Documentation
SORT
usage
<SEARCH>
<object>
...
</object>
<SORT select="xpath" order="{ascending/descending}" [data-type="{text/number}"]/>*
</SEARCH>
paramètres
select : The field on which you want to sort
order : if the sorting must be from the smallest to the largest (order="ascending") or from the largest to the smallest (order="descending")
data-type : Whether it must be an alphabetical order (data-type="text") or a numeric order (data-type="number"). If you must sort on a date, use the text data-type.
Indicates which field must be used for the sorting of the objects (Contacts, Groups, etc).
The field can be in INFO or DESCRIPTIONS
Be careful to place the SORT node inside the SEARCH node.
If a field exists in shared description AND in the visitor language, the sort may be not what you would expect, as we don't know which value is more important.
exemples
<SEARCH>
<MEDIA>
<INFO>
<MEDIATYPE operator="=">News</MEDIATYPE>
</INFO>
</MEDIA>
<RETURN>
<INFO />
<DESCRIPTIONS/>
<CATEGORIES />
</RETURN>
<SORT order="ascending" select="INFO/CREATIONDATE" data-type="text" />
<SORT order="ascending" select="INFO/ID" data-type="number" />
<PAGINATE display="5" page="1"/>
</SEARCH>
<SEARCH>
<MEDIA>
<INFO>
<MEDIATYPE operator="=">Product</MEDIATYPE>
</INFO>
</MEDIA>
<RETURN>
<DESCRIPTIONS/>
</RETURN>
<SORT order="ascending" select="DESCRIPTIONS/DESCRIPTION/CUSTOM/Price" data-type="number" />
</SEARCH>