Orchard 中的排序和过滤列表 [英] Sorting and filtering lists in Orchard

查看:54
本文介绍了Orchard 中的排序和过滤列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我关注了 创建列表href="http://orchard.codeplex.com/" rel="nofollow">Orchard Project 文档,但我正在努力思考如何在最终呈现的摘要中最好地实现我喜欢的排序顺序和方向显示内容项.

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.

附言如果您知道这个问题的答案,那么您可能正在按照 果园模块挑战;何不试试并有机会赢取 TV/XBox/KINECT!

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!

迄今为止的研究:

我注意到 Container 部分中的排序是使用以下属性实现的

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

按属性排序(Orchard.Core.Containers.Models.ContainerPartRecord)

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

推荐答案

在 Orchard 1.4 中,您可以使用 Projection Module 来实现这一点.

In Orchard 1.4 you can Projection Module to achieve that.

在以前的版本中,我使用 LINQ 查询对自定义字段进行排序.

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

这篇关于Orchard 中的排序和过滤列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆