I'm using contemplate for custom node layouts, and use it to place the fivestar widget via the <?php print fivestar_widget_form($node);?> code.
Strange behaviour I'm seeing includes:
- ability to continue to add multiple ratings, even though this is set 'never' in settings
- ability to change your rating, even though this is not checked off in settings
- multiple explanatory lines of text when both average and user rating are displayed side-by-side, as you mouseover the icons:
Average: Your rating:
* * * * * * * * * *
Awesome
Awesome
^^^
helper text is displayed twice, based on whatever icon you hover over
- 'your rating' (based on IP for anon) does not show up upon page refresh (stars are blank); however average rating shows up
- 'static' option doesn't keep the widget static (believing that this means it should hold a fixed place on the page, and won't push anything below the widget downwards when help text is displayed on screen)
Brad
Comments
Comment #1
BradM commentedThe above strange errors were due to the fact that I am trying to use it with a CCK node, but I hadn't set it up properly...although votes were recorded, no votes were passed back to the node. So in re-reading the readme file, plus a few posts, I thought I had it right, but it isn't working.
Basically I have created a whole bunch of 'movie' CCK nodes, which I want members to be able to rate. The output is custom formatted using the contemplate module.
Here's my setup for the CCK node type "movie" :
- disabled 5-star on the node type itself (as per readme)
- added field 'movie_rating' to node type 'movie' (as per readme)
- set up and added php code to retrieve the NID as explained here http://drupal.org/node/148150#comment-563516 (also changed the
$node->field_ratingcode to match the movie field)- in the contemplate body template, I added this code to add the fivestar widget:
- set access control for all to both rate and use php for target
Now, on the movie nodes, I see 5 blank stars (or a rating, based on my previous failed attempt to implement it) -- but nothing happens when I mouseover, can't record a vote, etc. Basically it just shows the stars and that's it. So this at least tells me that the $current_rating line is working correctly; it's just that no one can vote now.
Sorry for the long post, just trying to get everything down 'on paper.' Any ideas on what I might have done wrong?
Thanks,
Brad
Comment #2
quicksketchSounds like the source of the problem you're currently reporting is the use of the 'Static display'. This means that the widget is displayed in a way that displays the result but does not let users vote.
The problems you're reporting with duplicate help texts might be caused by theming functions in your template.php file. Are you over riding any theme functions? They might have changed since the 1.10 release.
Comment #3
quicksketchClosing after 2 weeks with no activity.
Comment #4
jshuster@drupal.org commentedI found an easier way to to attach a fivestar widget to a node that's formatted using contemplate: create a fivestar widget field in your content type using the instructions in the readme file. Then, to display the widget, place the following in your template:
This is one of the body and teaser variables listed in contemplate. Works like a charm.
Just documenting here, for those who follow ... I'd propose adding this to the readme file.