I have overridden the display of blog nodes on my site so that the entire body is not printed, just $node->content['body']['#value'] and no longer see the fivestar widget. I'd like to use the "Five Star widget location: Hidden -- my theme will display it" option under the blog content type properties but don't see in the documentation an explanation of how to do this. Am I missing something? Thanks!

Comments

ezra-g’s picture

A solution that worked for me was in node-blog.tpl.php:

<div class="fivestar">
<?php
$fivestarwidget = fivestar_widget_form($node);
print $fivestarwidget;
?>
</div>
wops’s picture

I use the following code:

print $node->content['fivestar_widget']['#value']

eaton’s picture

Status: Active » Closed (fixed)

fivestar_widget_form($node) is in fact the right call for it.

Anonymous’s picture

Status: Closed (fixed) » Active

A followup question:

The above is working for me but its the default settings. I'd like to define $element and call fivestar_theme from my templates.

So wanting to use

$element = (assoc array with title, value, options, description, extra, multiple, required) 
print theme('fivestar', $element);

Can then define the title and options and so forth specifically in the element array. Could you provide a sample of what that associative array needs to look like. I've tried it a handful of ways and get some results but not the widget.

Thank you.

mr700’s picture

Status: Active » Closed (fixed)

Why define new $element? No need to go to such trouble, simply do:

print theme('fivestar_static', $your_average, $your_maximum);