4

I'm building a rating site and using Views to display top rated (Fivestar + Voting-api) content -- but calculating what is top rated is where I'm lost now. Here's my View:

http://dl.dropbox.com/u/2188345/views-sorting.png

As you can see I've got things nicely set up, they are sortable etc. but now I'd need to add a final column showing the average score of those three combined, per node. I first thought I'd achieve this easily by creating a views template, and it was ok partially, but sorting didn't work as one would expect (since values were summed on the fly, not before the actual sorting happens).

Is there some smart way to combine values of those three relations via Rewriting - or some other means?

3 Answers 3

3

Would Computed Field be of use to you here? You might need to duplicate the three ratings fields with a different output (and hide them) but then you should be able to do some calcs on the result.

0
2

that's a tricky one, don't have a good answer, just an idea: You might want to setup a "final" rating.

Then use rules to add each of the individual rating to the final rating. Your vote count would be off but the average rating should work.

1
  • I'd imagine having to do that in case calculating doesn't work out. Thanks for your input.
    – red
    Nov 30, 2011 at 10:55
1

I managed to solve this by using the numeric value of the ratings in the table, but rewriting the display to show the star amount - this way drupal understands how to sort it and the users see the star values.

Sometimes simplest way is the best :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.