I've created a voting widget. I've voted on an article, but in Views I can't seem to find how to sort by the rating the article or its comments have received. Is this working in the version I'm using? Thanks!
I've created a voting widget. I've voted on an article, but in Views I can't seem to find how to sort by the rating the article or its comments have received. Is this working in the version I'm using? Thanks!
Comments
Comment #1
IRoar commentedI'm also having trouble figuring out how to get a view to demonstrate a sortable list of ratings. I have followed the instructions in part 6 of the readme file, but they are not very comprehensive instructions. Is there anyone who can offer a little help on how to get this working?
Comment #2
mauritsl commentedYou can sort the view on rating by adding a relationship to the vote results (as described in the rate readme). Be sure to set the aggregation function to average. You can now add a sort criteria on 'Vote results: Value'.
Comment #3
emmajane commentedThanks!! I think that's for all nodes with a vote, what about comments with a vote? Can those be sorted too?
Comment #4
IRoar commentedAha! Under the voting widget field "Tag" I had changed it from the default "vote" to "xxxx" because I understood from the help text (saying "Tag used for VotingAPI. Widgets with the same tag share their voting results.") that if I wanted to get average voting info for different criteria, then I would need to make my own tags ie. "xxxx" and "yyyy" to get two different averages. When I select my own tags, however, there is no result displayed on my view. I tried going with the default "vote" tag and it gave the expected output, but what if I have two main categories of things being rated, like x's and y's. Is there a way to get the averages of these votes sorted into their respective categories? I'm assuming that I would just add a filter?
Comment #5
emmajane commentedComment #6
mauritsl commentedThe value of the "tag" has to be the same as the tag filled in in the Rate admin (this is the thirth field when editing a rate widget). "vote" is just the default setting for this, it's called "Normal vote" in the votingapi views integration.
You can indeed use that tag in the relationship to sort on ratings with that tag. Does that work for you?