Sorting your media results now possible
From now on, when you list multiple media files from the Media service, you can sort your results by Content-Type and/or metadata attributes.
Meet the sort query parameter
To sort your results, set the sort query parameter to:
Content-Type
to sort by the type of media files you list{key_name}
to sort by the metadata attribute
Specify the sort order by providing the asc
or desc
value after the colon. The default sort order is ascending. See the examples that follow.
To combine multiple sort parameters, separate them with a comma.
Examples
Sort by Content-Type in descending order
?sort=Content-Type:desc
Sort by metadata attribute in ascending order
?sort={key_name}
Sort by multiple metadata attributes
?sort={key_name_1}:desc,{key_name_2}:asc,Content-Type:desc
Sort by both Content-Type and metadata attributes
?sort={key_name_1},{key_name_2}:desc,Content-Type:desc
If you find any information that is unclear or incorrect, please let us know so that we can improve the Dev Portal content.
Use our private help channel. Receive updates over email and contact our specialists directly.
If you need more information about this topic, visit hybris Experts to post your own question and interact with our community and experts.