Rate Module: Display the rating in the comment user added to the node

by Jose Daniel   Last Updated March 14, 2019 21:07 PM

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!

Tags : comments rating


Answers 2


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

shrish
shrish
May 23, 2014 12:23 PM

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.

Jeroen
Jeroen
May 23, 2014 18:32 PM

Related Questions



How to monitor comment / reviews?

Updated July 09, 2016 08:03 AM

Users rate and comment each other after an event?

Updated April 20, 2015 21:03 PM

How To Open The Comment Form In Modal Form

Updated December 29, 2016 08:03 AM

How to grab a user's Fivestar voting value with Rules?

Updated September 11, 2017 20:07 PM