We're doing simple reviews on a section of our site, while we wait for DruBB to come out so we can switch to nodecomments. In the mean time, we need for fivestar ratings in comments to affect the overall rating at the top of the node, which should only display the results. Ratings in the comment form are working and votes are sticking as expected (the comment is showing the vote the user cast), but the only way we can get the Node's overall rating to appear is if we choose "Fivestar Stars (clickable, with text)" from the Appearance pulldown in the View Field settings for the Voting Results field. If we choose "Fivestars (display only)" the stars are gray, showing no votes

Is it possible to have the stars be non-clickable? We want it to just *display* the total of the votes submitted from comments, we don't want users to be able to vote from the widget.

oh, we're using the latest Views, Panels, Fivestar and Voting API modules if it matters.

Comments

friolator’s picture

Title: Average rating can only be clickable? » Overall rating can only be clickable?
quicksketch’s picture

You've probably just set up your relationships to use the user's vote instead of the average. When adding the VotingAPI relationship, choose "Node: Vote results", and not "Node: Votes". Then add a field for "Vote results: Value" and select the Fivestar display only format.

friolator’s picture

That does work but it doesn't show the vote average or count as text, as it does in the clickable version. That's what I was getting at in the original post. We want the widget to display both the stars and the text showing total votes cast and the average of those votes.

That's not an option from the drop down menu in the Voting API Results field (ie: we want "Display Only, With Text")

Is there another way i can pull this information in views and just rewrite the output of the field so it has the numbers? It's not clear what I'd choose in terms of relationships and fields in order to accomplish this. ...assuming it's possible at all.

Thanks!

friolator’s picture

Status: Active » Closed (fixed)

Ok, I figured this out. Hopefully this recipe will be helpful to people looking to do this:

1) set up a relationship for Node: Voting Results. Use "Value Type: Percent" and "Aggregation Function: Average"

2) set up a Voting API Results field that's related to this first relationship, set it to Display Only. Make sure the field is set to "Exclude from Display"

3) set up a second relationship for Node: Voting results, with "Value Type: Percent" and "Aggregation Function: Count"

4) set up a second Voting API Results field that's related to the second relationship.

In this second Voting API Results field, re-write the output to something like: "[value] (based on [value_1] reviews)"

This gives you the fivestar widget -- "[value]" -- and the numeric count -- "[value_1]" -- all together.

That said, It would still be nice if there was an option in the Field's drop down menu for Display Only With Text

weka’s picture

Version: 6.x-1.15 » 6.x-1.19
Category: support » feature
Status: Closed (fixed) » Active

Thank you thank you thank you friolator !
Your recipe is a great workaround for this limitation.

dbt102’s picture

Issue summary: View changes
Status: Active » Closed (won't fix)

Drupal 6 is now end of life, and is no longer supported. So Drupal 6 issues for Fivestar are being closed as "Closed (won't fix)". However, we don't want users who are porting from Drupal 6 to 7 to feel unwanted, so if you have any migration issues, please open them as Drupal 8 issues.