sorting lists

Topics: Customizing Orchard
Feb 4, 2012 at 5:54 AM

When users add a list item I'd like them to input a "sort order" field and order by that.

I don't understand how fields get flagged for inclusion in the sort order - like the custom part.


I'm brand new to orchard, please point me to a help topic or explain it.

Feb 4, 2012 at 7:08 AM

You'd have to start overriding stuff to make this work; either the containers controller in 1.3, or the ContainerPartDriver in 1.x (latest source branch, soon to be 1.4).

However Orchard 1.4 will have a new feature called Projector which solves this problem and tons of others; it's a new way of generating custom lists from any type of content query, so you can for example add a custom field to sort on.

Also, I wrote a module called Mechanics which is a more flexible way to build relationships than Lists. It lets you specify a sort order by adding a special "SequencePart" to the connector type, you then get a Sequence input to reorder the lists. There will be a vastly improved release of this module once 1.4 is out; the current version on the gallery has various known issues and the code has gone through a major rewrite to solve them and add new features, so there hasn't been a release for a while!

Feb 4, 2012 at 12:16 PM

Pete, thanks for the quick reply.

I'm definitely looking forward to 1.4 :)