Active
Project:
Fivestar
Version:
7.x-2.0-alpha1
Component:
Documentation
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
13 Aug 2011 at 16:57 UTC
Updated:
17 Dec 2011 at 00:03 UTC
Hello,
I`m building an review site, and i`m wondering, if it`s possible, to allow only the users who posted a comment, to rate the node that they posted the comment on.
I done some search, and did not find anything regarding this.
Is this possible?
Thanks,
Best regards
Comments
Comment #1
sslider999 commentedAnyone?
Thanks
Comment #2
ohthehugemanatee commentedProbably the easiest way to do this would be to have the rating actually on the COMMENT form, rather than the node. Then create a view to display the average comment vote on each node.
Comment #3
sslider999 commentedHello,
Thanks for the answer, but how this will prevent others to rate / vote?
Comment #4
ericduran commentedYes this is indeed Possible.
Here are the directions:
Hopefully this is the begining of some documentations.
1. Create a fivestar field on the content type, the widget you want to use is Stars (rate while viewing). Select your tag (its vote by default)
2. Go to the manage display screen for that content type and edit the fivestar field display and uncheck the "Expose this Fivestar field for voting in the Default display on the Article type"
3. Go to the Comment Fields display for that same content type. Add another fivestar field to the comments. Make sure to select the same tag as the preview field (vote by default). Select Stars (rate when editing).
4. In field settings make sure to select "Parent Node" for the voting target options.
Now This should be all set.
When a user creates a comment they will have a fivestar field within there comments, when they save the comment the rating value will be voted against the parent node.
I know I just ran through most of these settings but this should get you the behavior you want.
I'll be working on some views and articles explaining how to use all these features soon.
Comment #5
ericduran commentedNote: Views is not required for this functionality. A lot of people tend to this that this is a requirement and end up finding it to be more complicated.
This is built in with in fivestar and views is completely unnecessary for this functionality.
Comment #6
gramoun_kal commentedEDIT: Fixed, my mistake. See below if you want to avoid doing the same
Following these instructions, that are also in the manual, I reached an odd result. Everything works as expected except that the rating displayed on the node is not the average of all ratings in the comments, but the latest rating submitted in the comments.
So if there are two comments, the first with 1 star, the second with 5 stars, the node will display a 5 star rating, with the label "average 5, 1 vote".
EDIT: This will happen if all comments are posted by the same user. If you post 3 comments including 2 from the same user, fivestar will output the average of [the latest comment from the one that posted twice] and [the comment from the one that posted once]. It's probably doing what one would expect it to, except for my particular case.