Listing documents within folder, sorted by current order

Hi,

I wonder if anyone has stumbed upon this.

We’re using the latest brxm version, and have created a slider of which the content is based on articles within a specific folder (the author selects a folder, the articles within are retrieved). A new requirement has come along: sort the articles in the same order in which they are listed within the folder. So whenever an author moves articles around, this order should be reflected by the slider component.

We’re currently using HstQueryBuilder in order to try and achieve this. However, when no sortField is provided, the order in which the documents are returned does not reflect that of the manually sorted one. If there is an explicit sortField we can use in order to achieve this (or some other way of tackling this), we’d be happy to hear it.

Cheers,
Robin.

Instead of getting the documents from the query, get the folder. From the folder bean you can call getDocuments(false) or getDocuments(DocumentType.class) which should return in the order of the repository.

Thanks for the quick response. I’ll check it out.