2

Is there a way to display the rating in comment given by a user in the node? For example, in this page http://www.yelp.com/biz/ikes-place-san-francisco at the top we can see the total rating, but in comments we can see the rating given by the user.

Is there some way to do this? Thanks!

bumped to the homepage by Community 14 hours ago

This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.

0

Five Star module is what you are looking for,

The Fivestar voting module adds a clean, attractive voting widget to nodes and comments and any entity. It features:

  • jQuery rollover effects and AJAX no-reload voting

  • Configurable star sets

  • Graceful degradation to an HTML rating form when JavaScript is turned off

  • Support for anonymous voters

  • Spam protection to keep users from filling your DB with bogus votes

  • Easy-to-use integration with Views module for lists sorted by rating, or filtered by min/max ratings

  • A Fivestar CCK field for use in custom node types

  • An easy-to-use Form API element type for use in other modules

  • Compatible with all versions of jQuery (1.0 - 1.8)

Check out this awesome, Demo video

  • Can you confirm whether Fivestar works this way? In other words, display a user's particular vote next to their comment, in addition to the aggregate vote for the node. – mpdonadio May 23 '14 at 14:08
  • I have done this, yes it does aggregate the Rating from the individual comments. Please check the quick video tour :) – shrish May 23 '14 at 14:57
0

I achieved a similar thing with the Fivestar module. The trick is to let the users vote when they comment. You can find a whole description for the set-up at https://drupal.org/node/1308114. Here is an adapted version of the documentation:

Setting up the content type

  1. Go to admin/config/content/fivestar and create a new tag, e.g. called Vote or Rating.
  2. Go to your content type and add a new Fivestar field, e.g. called "Rating".
  3. Select the widget type Stars (rated while viewing) and tag the Rating.
  4. Select the number of stars. Make sure it will be the same on both the content type and the comments.
  5. Go to your content type's display settings and click the settings button for the Fivestar field.
  6. Set Value to display as stars as Average Vote.

Setting up the comments

  1. Go to the comment field settings for your content type.
  2. Use Add existing field and add the same Fivestar field you created for the content type.
  3. Widget: Stars (rated while editing).
  4. Select the number of stars, equal to the amount that's used in your content type.
  5. Select the voting tag you created earlier and set the voting target to Parent Node.
  6. Go to the comment display settings and click the settings button for the Fivestar field.
  7. Set Value to display as stars as User's Vote and change Text to display under the stars to User's vote.

I asked a question about how to display the average rating as stars before: How to display the average rating of a node as stars in a view?. Maybe that can help you too.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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