Hello!
Is there a possibility to sort content by votes? I've created a view that shows only nodes of a certain type. You can also vote on these articles, using vote up/down. I use the version where you only can vote up. all this works, but I can't get the view sorted by votes. I want to have the content with most votes first (or alternatively the content with highest vote-result, but in this case these two should be the same).
I've added a relationship in the view, (node: Vote results), And I try to sort by Vote results (Vote results: Value ). But the content still appears in the same order, not with the most voted first. I've tried every alternative in the relations-area, but nothing works.

I am also using fivestars for rating another type of content, can this be a problem? That content is easy to sort by highest rating, but not the content that I use vote up/down no..
Someone having any ideas?

Comments

groenm’s picture

Maybe you are showing your nodes in a table view? If that is the case, keep in mind that the table view has its own sorting mechanism in order to allow the user to click a column to reorder the table. To change the sorting settings of the table view, click on the little gear icon after the table setting in your view. Here you should be able to set up the default sorting and the allowed sortings.

Mark

mgenovese’s picture

In views, it happens when using a "row style" as a node (versus fields). There's no ability to sort by anything to do with votes. When using a row style of fields, you then have the ability to sort by votes cast. Unsure why this isn't available for the node row style.

groenm’s picture

The following settings work for me:

Basic Settings, Style: Unformatted
Basic Settings, Row Style: Node (Build Mode: Teaser)

Relationships, Node: Vote Results (Value type: No filtering; Vote tag: No filtering; Aggregation function: Average Vote)

Sort criteria, Vote Results: Value (Sort order: Descending)

I further filtered on node type, but for the rest, I didn't really change any of the default settings. My nodes are now ordered from highest average vote down to lowest.

Maybe you added a CCK-field for the votes, instead of using the (user) vote options from the edit tab of the node type? In that case you would have to sort on the specific CCK-field.

Anyway, I hope my settings above bring you a bit closer to the solution.

joecanti’s picture

you could also try checking out the lullabot video here - http://www.lullabot.com/videos/building-views-fivestar-and-votingapi

its for fivestar, but that also uses votingapi to do all the heavy lifting so the views stuff in the video should help.

joe

.kuma’s picture

I had to add a Relationship in the view before sorting by votes became an option.

Sepero’s picture