Sorting and filtering lists in Orchard

浪子不回头ぞ 提交于 2020-01-02 10:05:54

问题


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)


回答1:


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.



来源:https://stackoverflow.com/questions/5223279/sorting-and-filtering-lists-in-orchard

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!