Closed (fixed)
Project:
Fivestar
Version:
6.x-1.19
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
15 Jul 2007 at 22:09 UTC
Updated:
8 Jun 2012 at 22:49 UTC
Greetings, all.
I've been trying to figure out how to display a fivestar voting result in teaser view ... But the result only, so that people can't vote without viewing the full node. But I'm not having much luck.
I can create views which have this functionality (displaying only the result), so I'm sure a function must exist ... but how would I go about adding this to a node teaser?
Thanks in advance!
-jthorson
Comments
Comment #1
spooky69 commentedSubscribing
Comment #2
quicksketchThe best way to do this is by defining some new variables in your template.php file and then using them in your node.tpl.php files.
If you're not familiar with using template.php, you could use this slightly more hackish approach, either using contemplate module or directly in your node.tpl.php files.
Comment #3
jthorson commentedAlmost perfect ... the second option should be written as:
But you gave me enough that I was able to piece it together from there ... the 'fivestar_static' function was the piece I was missing.
Many thanks!
Setting the ticket status to Closed.
Comment #4
seanburlington commentedI came across this issue looking for the solution in Drupal 6
In case anyone else needs it - put the following in hook_preprocess_node()
(assuming your votes are for nodes)
Comment #5
halloffame commentedHow about if I want to print the average in numeric value?
Comment #6
halloffame commentedComment #7
jthorson commentedevilgenius,
If you have a new question, please open it as a new issue. (You could, however, place a link to this issue in your new issue, to help provide context.)
As for your question, output the $current_rating value directly (without wrapping it in the theme() function).