I'm using smart content for displaying custom article type (news). At documentation:
https://docs.sulu.io/en/2.2/reference/content-types/smart_content.html#
it says "Depending on the DataProvider you can define where the items come from (Datasource), what tags the filtered items must have, how they are sorted, and how many results you want to get." but then not a word about how to define sorting?
Data provider is article bundle: https://github.com/sulu/SuluArticleBundle/blob/2.x/Resources/doc/content-types.md
but again, not a word about how to set order field and order direction.
I want to sort them by creation date, newer to older, probably most common sort direction. How to achieve that?
If you have a look at the
Blog
page in the sulu demo administration interface (https://sulu.rocks/admin), there is a smart content calledArticles
. If you open the configuration overlay for that smart content, some filters appear, one of those isSort by
, another oneSort direction
. You can sort the results of the smart content using those filters.