Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sorting and filtering lists in Orchard

Tags:

orchardcms

I've followed the topic 'Creating lists' in the Orchard Project docs but I'm struggling to think how best to implement my preferred sort order and direction in the resulting rendering of Summary display of the content items.

For example, if I create a Book Reviews list as in the example, and I then add a Published Date field following the topic 'Creating a custom field type' then how would I alter my theme or the views in the Module to display (and possibly also filter) the content items by that custom field.

The 'Creating lists' topic discusses how widgets can implement sorting and filtering, but not how the main content type can do so.

p.s. if you know the answer to this you're probably well on the way to being able to implement an Event Calendar Module as suggested by the Orchard Module Challenge; why not have a go and stand a chance to win a TV / XBox / KINECT!

Research to date:

I've noticed that ordering in a Container part is implemented using the following property

OrderByProperty (Orchard.Core.Containers.Models.ContainerPartRecord)

like image 358
rohancragg Avatar asked Nov 29 '25 03:11

rohancragg


1 Answers

In Orchard 1.4 you can Projection Module to achieve that.

In previous versions, I used LINQ queries to do the sorting on the custom field.

like image 163
NomadTraveler Avatar answered Nov 30 '25 23:11

NomadTraveler



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!