Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I think it would be useful to have a node for total node counts. Right now I can arrange by vote results. But that means an item with 1 vote of 5 will be as high as an item with 20 votes of 5. Is there anyway to arrange by vote count, as well as voting results?
Comments
Comment #1
quicksketchThere is an Views option for total vote counts, but it'll only do you a small amount of good for sorting. Sort first by vote percentage, then by vote count. This will make your view sort all items similar to this:
Item 2 (5 stars, 20 votes)
Item 3 (5 stars, 2 votes)
Item 1 (5 stars, 1 votes)
Item 4 (4.9 stars, 120 votes)
You might expect the on with 4.9 stars and 120 votes to be above item 3 (but not above item 2?). It's hard to say what's correct here. You might also filter your View so that items with less than 5 votes don't get included at all. I don't know a way of making it so that they would show up, but only at the bottom.
Comment #2
sammyman CreditAttribution: sammyman commentedI don't see any node for total vote count? Where might I find this node?
Voting API results: Function
The aggregate function used to calculate the result.
Voting API results: Tag
An optional tag to group multi-criteria results.
Voting API results: Timestamp
The time the results were calculated.
Voting API results: Value
The value of an individual cast vote.
Voting API results: Value type
The nature of the results in question (points, percentage, etc).
Voting API votes: IP Address
The IP address of the user who cast the vote.
Voting API votes: Tag
An optional tag to group multi-criteria votes.
Voting API votes: Timestamp
The time the vote was cast.
Voting API votes: User
The user who cast the vote.
Voting API votes: Value
The value of an individual cast vote.
Voting API votes: Value type
The nature of the vote being cast (points, percentage, etc).
Comment #3
quicksketchIt is part of "Voting API results: Value", when "Voting API results: Function" == 'count'.
Comment #4
sammyman CreditAttribution: sammyman commentedSo do I setup a relationship for "Voting API results: Value" with Value type: points, Vote tag: vote, Aggregation function: count, and then setup a sorting option for "Voting API results: Function" with the relationship above? I tried that but for some reason it is not working...
Comment #5
quicksketchYep, pretty close, only your value type should be "percentage", not "points".
Comment #6
sammyman CreditAttribution: sammyman commentedHmmm. Still not working.
I setup this test
http://www.juicydeals.net/test-counting
It is only being sorted by the following:
"Voting API results: Value" with Value type: percentage, Vote tag: vote, Aggregation function: count, and then setup a sorting option for "Voting API results: Function" with the relationship above?
There are no other relationships... This is awfully strange.
Comment #7
sammyman CreditAttribution: sammyman commentedStill haven't figured this out. I think there is a bug when trying to use the "count" function.
Comment #8
quicksketchsammyman opened a duplicate here: #357212: Node for Vote Count?
I tested this again and it's still working fine. There's not any more I can do to help.
Comment #9
AntiNSA CreditAttribution: AntiNSA commentedI have selected the Vote Results Relationship
I have tried both require and not require and they both do not work,
Vote tag: Normal Vote
Vote Results:Function
and for my view I only have the word "count" and not the number of votes that were made for the node.
I can get the average rating, and my rating... why not the total votes?
Comment #10
AntiNSA CreditAttribution: AntiNSA commentedComment #11
AntiNSA CreditAttribution: AntiNSA commentedok I got it. Set your relationships first. Then you need to also selecect vote results:value and match it to your set relationship, Exclude the function from the display.
Comment #12
popestepheng CreditAttribution: popestepheng commentedI have this problem too... I setup the Voting Results Relationship for Voting Result for Number of Vote ( I also have one for average )
but one, when I add the field for number of votes, all it says is "count" in the field display, not a number, , and in the filter section, when I select Voting Results (Number of votes) field, it only gives me string like filters, not numbers.
Comment #13
glitz CreditAttribution: glitz commentedunable to show simply the 5 start disply showing avg rating, with a colum next to it showing the total number of votes.
do someone have a screenshot of how this is set up?
thx
Comment #14
glitz CreditAttribution: glitz commentedgot it thanks
Comment #15
calefilm CreditAttribution: calefilm commentedIf any of you have the opportunity to demonstrate a programming procedure please do so! It will help a lot of people in the long run and help Drupal grow much faster Luck!
Add View
Style: Table
FILTER
Filter to content type of which relationship is defined
(in my case I have two content types, "product" and "review". I followed this tutorial before I set up anything: http://drupal.org/node/457886 )
RELATIONSHIPS
Add Relationship
Select Node
-Node: Vote results
Label
Value type: Percent
Vote tag: this is a label of one of your node ratings already created
Aggregation function: number of votes (or input count)
FIELDS
Add field
Select Vote Results
Select Function
Select corresponding chosen relationship
Label
Add field
Select Vote Results
Select Vote results: Value
Choose appearance
Select corresponding chosen relationship
Label
SORT
Select Vote results
Vote Results: Function