Is there a specific reason the fivestar widget is not shown on the teaser or an option somewhere?

I commented out the check and it seems to work OK just want to make sure

    case 'view':
      if (/*$teaser == FALSE && */$node->in_preview == FALSE && user_access('rate content') && variable_get('fivestar_' . $node->type, 0)) {

thx

CommentFileSizeAuthor
#4 fivestar-teaser-ext.patch5.38 KBmr700
#3 fivestar-teaser.patch1.91 KBmr700

Comments

liquid8’s picture

I did a modification that adds an additional option 'teaser' which if selected will show it in the teaser, and below the node.

You can get the modified .module here:

http://timhoeck.com/files/uploads/fivestar-mod.zip

dldege’s picture

Cool.
If you post it as a .patch file then it could be considered for inclusion in the main line code. I have a couple other mods to fivestar so if you posted a patch I could also use it since I can't just use your version.

Some more info - http://drupal.org/patch.

Thx.

mr700’s picture

StatusFileSize
new1.91 KB

Here's the original as patch...

mr700’s picture

Status: Active » Needs review
StatusFileSize
new5.38 KB

And here's a patch that adds all possible combinations for render by theme/above/below the body/teaser. This one also removes some white space from the end of the lines.

mr700’s picture

Status: Needs review » Fixed

It's fixed in the current cvs (1.2.2.5) in a better way, it has 'Widget location (teaser)' and 'Widget location (full node)'.

hquadrat’s picture

Hi there... is there also a solution for the current version 1.3? I'd like to show the rating also on teasers for some content types but not for all I use this module for. (I already applied the patch for showing the average rating up to now.)

mr700’s picture

hquadrat, the fix is in the cvs which is newer than 1.3 - just wait for the next release.

The second part is a feature request, please fill a new one. Currently you can do it in your theme's node-node_type.tpl.php like this:

...
$current_avg = votingapi_get_voting_result('node', $node->nid, 'percent', 'vote', 'average');
$current_count = votingapi_get_voting_result('node', $node->nid, 'percent', 'vote', 'count');
$fivestar_summary = theme('fivestar_summary', $current_avg->value, $current_count->value);
$fivestar_summary_fancy = theme('fivestar_static', $current_avg->value);
...
print $fivestar_summary_fancy;
...

Maybe documenting this is enough, maybe these two can be exported to the variables exported to the theme...

Anonymous’s picture

Status: Fixed » Closed (fixed)