创建一个 Drupal 视图,其中包含按月份投票最多的节点列表

发布于 2024-10-10 16:45:09 字数 278 浏览 0 评论 0原文

我正在使用 Drupal 6 Views 模块来请求使用五星级模块评级的顶级节点。但是,我似乎不知道如何创建一个视图来请求每个月投票最高的节点并将它们显示在列表上。

我想要的结果是这样的列表:

  • 2011 年 1 月:投票最多的节点标题 到该节点的链接
  • 2010 年 12 月:投票最多的节点标题 到该节点的链接
  • 2010 年 11 月:投票最多的节点标题 到该节点的链接
  • ...

我什至不确定这是否可以使用视图?

I'm using the Drupal 6 Views module to request for top nodes rated using the fivestar module. However, I can't seem to find out how I can create a view to request for the top voted node for each month and display them on a list.

What I'd like as a result is a list like this:

  • January 2011: Most voted node title an link to that node
  • December 2010: Most voted node title an link to that node
  • November 2010: Most voted node title an link to that node
  • ...

I'm not even sure this is possible using Views?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

演多会厌 2024-10-17 16:45:09

通过投票关系设置您的观点。
(更多信息请点击这里 http://www.lullabot.com/videos/building -views- Fivestar-and-votingapi

确保按投票结果降序排序。
根据上面的示例,只需添加“节点标题”字段并选中“将此字段链接到其节点”即可。

其次,您需要根据日期值对列表进行分组。

  1. 添加字段节点发布日期。复选标记从显示中排除。将日期格式设置为自定义值“F Y”(即“月年”即2011年1月)
  2. 开箱即用的视图不支持将每个组限制为一定数量,因此您需要下载“视图限制分组”模块(在 drupal.org 上搜索)
  3. 安装后,将视图样式更改为“分组字段”并将项目限制为 1。

这应该可以解决问题。

Set up your view with the voting relationship.
(more info here http://www.lullabot.com/videos/building-views-fivestar-and-votingapi)

Make sure you sort by vote result descending.
According to your example above, just add the Node Title field and checkmark "link this field to its node".

Secondly, you need to group your listing based on a date value.

  1. Add the field node post date. Checkmark Exclude from Display. Set the date format to Custom value of "F Y" (That is "Month Year" i.e. Jannuary 2011)
  2. Views out of the box does not support limiting each group to a certain number, so you need to download the "Views Limit Grouping" module (search for it on drupal.org)
  3. Once installed, change the views Style to "Grouping Field" and limit items to 1.

That should do the trick.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文