Closed (fixed)
Project:
Fivestar
Version:
7.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
3 Apr 2011 at 15:17 UTC
Updated:
14 Jan 2018 at 12:02 UTC
Jump to comment: Most recent
Comments
Comment #1
brz commentedComment #2
gjones commentedprint render(fivestar_widget_form($node));Works for me.
Comment #3
jjones2008 commentedI have tried both ways and neither work for me in drupal 7. I keep getting the error "Call to undefined function fivestar_widget_form()" Any ideas why I cannot print the fivestar widget?
Comment #4
brz commentedNow with CCK field:
You have to create Fivestar field (in this case "vote" field).
Hi
Comment #5
jjones2008 commented@brz thank you very much! It works great for me.
Comment #6
rogical commentedCan you give some guide on how to render it on user page? I just want to render it in author pane.
Comment #7
thoughtcat commentedI've got the same problem trying to output the rating widget in a D7 site.
If I try the solution in #2 above, all styles fall off my page altogether.
If I try solution #4, the stars widget does not display at all. I have modified it to field_rate which is the name of my Fivestar field.
If I look at the available body variables in Content Templates, there doesn't seem to be any reference to the field at all. The field is not set to "hidden" in "manage fields" and the widget displays fine if I untick "affect body output".
Someone posted in a D6 issue that you could just activate a block for the page and the rating widget would display in there - is this not available for the D7 version? I can't see a relevant block in my blocks admin.
Comment #8
petkove commentedThx! Saved me. Also some themes require drupal_render method instead of render - eg. drupal_render($content['field_rating']); <- i created a field rating of type Fivestar rating.
--
http://eurobuecher.com
Comment #9
thoughtcat commentedChanging from print render... to print drupal_render... didn't fix it for me. (I'm using Bartik)
Comment #10
moonshdw8 commentedI tried all of the suggestions here (and everywhere else I could look), but nothing seemed to make the rating system appear on my custom product page. This is the one that finally did it:
I found the answer here: http://drupal.stackexchange.com/questions/25916/using-fivestar-get-votes...
Hope this helps someone else. It took me 2 days to find the answer.
Comment #11
NenadP commentedmoonshdw8, i confirm your solution works for me both in node and in other context! I had hard time with this.
Thanks for your hard work and solution :)
Only, how do you set styling , (pass the options about widget type - type of stars etc) as it is rendered as default and not the way is set in the field on content type field page ? How do you add fivestars tags, too ?
Comment #12
NenadP commentedBy intuition :) , i tried
To get the widget go with 'basic' widge type, and it worked! So you just pass an extra parameter with desired widget type!
EDIT: When i enabled "Expose this Fivestar field for voting on the @type type." it started to style te stars in those content type were field is defined.
Maybe someone has more info about those aditional parameters.
Comment #13
moonshdw8 commentedThanks HoverFusion for the extra feedback. That was something else I was having trouble with. It seems intuition is the only way i can ever figure out anything with Drupal :)
Comment #14
NenadP commentedmoonshdw8 no problem!
Only thing i noticed with this approach is that it is very performance costly when i tried to load it multiple times (I have books loaded as teasers, and then i loaded fivestar for every book - but site performance was drasticaly influenced in negative way).
I am not sure if this is because of Fivestar in general or in the way i output it.
Comment #15
dewancodes commentedI tried this and it worked for me.
You just need bit of css if you want to hide field labels etc.
Comment #16
barick_manoranjan commented#12 Worked...Great..
Actually I was looking for this in my node template:
$fivestar = field_view_field('node', $node, 'field_vote','oxygen');
Thank You.
Comment #17
feldmarv commented#10 works perfectly!