Sorting content picker

Topics: Administration, Customizing Orchard
May 29, 2013 at 3:28 AM
I'm using a content picker in my custom content type i've created. With the content picker, I pick 4 content items named (item1typeA, item2typeB, item3typeB, item4typeA).
Now this is nice, but I'm wondering if there is a way I can sort them without having to remove one and re-add it. Currently the picker allows me to pick the items and add them in, but if I want the order to change, ie, move the typeA items before the typeB items, I have to remove this. If I could just change the order (drag or bump order options) that would work, or additionally if I can define a sort for this list, it would be nice.
May 29, 2013 at 4:57 AM
Look a little closer: you can drag and drop them.
May 29, 2013 at 12:07 PM
"It's right under your arrow!"


How do I delete my post? It was 3am...... it's my story and I'm sticking to it....
May 29, 2013 at 1:48 PM
Here's another. But no arrow this time :(

I have a projection of 10 content-items (will be many more). There is a sort applied to a content-picker field. The sort appears to work but probably off of an ID? I ask this because I can't order this manually (which is ok) but I'd like to sort this by the title of the content picked.

contentTypeA, contentPickerItem2
contentTypeB, contentPickerItem2
contentTypeC, contentPickerItem1
contentTypeD, contentPickerItem1
contentTypeE, contentPickerItem3
contentTypeF, contentPickerItem3

contentTypeA, contentPickerItem1
contentTypeA, contentPickerItem1
contentTypeA, contentPickerItem2
contentTypeA, contentPickerItem2
contentTypeA, contentPickerItem1
contentTypeA, contentPickerItem1
contentTypeA, contentPickerItem3
contentTypeA, contentPickerItem3
May 29, 2013 at 2:07 PM
ContentPickerField stores content ids as a comma separated list, so I think it's sorted on that.
Looking at ContentFieldsSortCriteria.cs in Orchard.Projections/Providers/SortCriteria, I think you are in luck and will have to implement your own ISortCriterionProvider.