I have a quick question regarding sorting contents in the admin console.
I know that “”_manualordervalue DESC"" will fetch all contents according to its order, however in order for this to work you have to set “Manually Sorted” to be on in Sort Items menu.
I would like to fetch the contents according to its positions regardless what options is selected in Sort items menu.
If you use getChildren or query with a path you can use the parameters start and count (a bit unsure on exact paeam names, check the docs, im on mobile right now). Set start to 2 and count to 1 to get second item only.
You could also always get all content and that pick one with result.hits[4]
There is a sort parameter that will be applied regardless of specified order values.
The ordering in content studio will only apply when you are using content.getChildren I assume?
I think the default behavior in the Content Studio is to show the most recently modified content on top.
In both contentLib.getChildren and contentLib.query you can use sort: '_modifiedTime ASC' which will put the newest on top. Or if that doesn’t match, try 'DESC'. But I’m afraid that using the “sort” parameter will override the manually sorted items. There should be a way to check if a content’s children are manually sorted.
I would like to fetch the items in this exactly order that appears in the picture above (Finn riktig prove, Send inn prove, Prislister…) no matter what option is select in Sort items (could be “Manually Sorted”, “Modified - Ascending”, “DisplayName - Ascending”, …).
“_manualordervalue DESC” will accomplish that, however I need to set “Manually Sorted” otherwise it won’t work. If I change to any other option such as “DisplayName - Desceding” or “DisplayName - Ascending” then the “_manualordervalue DESC” will no longer work.