Order of items in library selected webskin


#1

Is there any way to change the sort order of items that are sent to the library selected to be sorted differently? I presume it’s currently sorted by date/time created. I need it to be sorted by a different field in the table.


#2

I remember doing something like this before.

Try adding ftlibrarydatasqlorderby=“mySortField” to your property.

Chris.


#3

Just realised this is covered in Corey’s recent, excellant blog post.

See https://tangerineindustries.wordpress.com/2016/08/12/farcry-cms-rules-populating-library-data/ for full details.

Chris.


#4

Hmm… but I’m not sure if this will work in the admin when selecting objects? Would it? This seems to be more geared towards hand picked/custom rules.


#5

The ftLibraryDataSQLOrderBy attribute is used to provide a sort order in the library picker when a user is selecting existing objects, is that what you mean?

After the objects are selected they go into a sortable array in the form where the user can choose a specific order for them if necessary. If you need to render those objects in a special order on the front end, you might have to write some code to do that.


#6

Correct, the library picker is where I need it to sort on. In this case I’m attempting to sort images by their when selecting them from within the image gallery.


#7

And that’s done it. I put that command, ftLibraryDataSQLOrderBy, into the image gallery image array and sorted by title. Woo!