I'm using contemplate to create a custom node layout.
How do I display the fivestar widget?
All I could find here is this:

<?php
$current_rating = votingapi_get_voting_result('node', $nid, 'percent', 'vote', 'average');
print theme('fivestar_static', $current_rating->value);
?>

But I don't want a 'static' display, I want the 'full' display.
What function should I use?

Comments

quicksketch’s picture

print fivestar_form($node);

should do the job.

quicksketch’s picture

Status: Active » Closed (fixed)
ofridagan’s picture

Thanks!
But... fivestar_form() take two parameters, and returns an array.
Can you please explain how to use it?

I tried to use:

<?php print theme_fivestar_widget(fivestar_form('node', $nid)); ?>

But it only shows text - no stars.

jeffrey.dalton’s picture

Title: Display fivestar with contemplate » Similar Question: how to call 5 star widgets in CCK node override

I have a similar question: I am theming the whole custom CCK type with node-custom_type.tpl.php and using 5 star with anonymous voting setting for this content type. Wondering how to call the 5 star widgets various configurations into the node-custom_type.tpl.php file?

I normally call custom fields as:

... print $field_custom_field_name[0]['view']

I am not using 5 star as a custom field so trying to figure out how to call it as a rendered widget?
Is there a way to do this for 5 star?

Peace,
Jeffrey

chadchandler’s picture

I think what QuickSketch forgot the widget part. Try this ...

 <?php print fivestar_widget_form($node); ?>
mmerlange’s picture

Hi,

Thank you for your tip.
I have 3 different cck using fivestar, how can I distinguish one form an other? I wish I had the 3 widgets displayed in differents parts of my template.

Thank you,
Michael