Create a Drupal view with a list of top voted nodes by month

﹥>﹥吖頭↗ 提交于 2019-12-11 07:36:31

问题


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?


回答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.



来源:https://stackoverflow.com/questions/4635299/create-a-drupal-view-with-a-list-of-top-voted-nodes-by-month

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