opengeek/getResources

FR: Sorting output like input

mindeffects opened this issue · 2 comments

Hi Jason,
quite often I need some IDs processes by your fabulous getResources, like:
&parents=-1 &resources=4,7,2,5,1

Nothing special. But: I need the output IDs sorted in the same way as the input IDs.

Sure, I can do it with this:
&sortby=FIELD(modResource.id, 4,7,2,5,1 )

Most of the time I use a chunk like "getResourcesOrdered" to which I hand over the ID list, so I do not have to type the IDs twice. Works, but is somehow a wasted chunk-call.

Now, here's the idea:
&sortby=resources

Does this sound like an idea worth considering? I hope so!

cheers
Oliver

This feature was added in ac92ba3

@opengeek came up with the FIELD solution in the first place.
Thank you guys for implementing it at MODX CCC 2015!