Fivestar Not Displaying Properly With Contemplate

Capricorn20 - August 22, 2008 - 20:19

I have been using Fivestar successfully for some time but have recently changed the layout of my page with Contemplate. As soon as I did this the Fivestar stars have been replaced with the original HTML drop down form.

If I change the Fivestar field from its original hidden to static, the stars show, however, when set to clickable the Javascript ones will not appear correctly.

<?php print $node->content['fivestar_widget']['#value'];?>

If I use the original widget code that worked on the untemplated pages then the static stars do not even show up.

<?php print fivestar_widget_form($node);?>

I can't understand why it doesn't work any longer. Is it that the Javascript is getting called at a different time? This is becoming quite frustrating now!

Any pointers? This is occuring on moviedb with contemplate. Example page is http://www.redeyereview.com/movies/2008/the_chronicles_of_narnia_prince_... and the block is under UserRating.

Thanks!

I have managed to fix this

Capricorn20 - August 27, 2008 - 12:31

I have managed to fix this after days spent on it!

I made the fivestar appear as hidden and within contemplate the call to the widget is:

<?php print fivestar_widget_form($node);?>

I added to my page.tpl.php template:

<style type="text/css" media="all">@import "/modules/fivestar/widgets/rerpublic/rerpublic.css";</style>

I also downloaded and added the new jquery 1.2.6 into my /misc folder.

I also added a missing $ to the last function within fivestar.js:

if (Drupal.jsEnabled) {
  $(document).ready(function() {
    $('div.fivestar-form-item').rating();
    $('input.fivestar-submit').hide();
  });
}

to become:

if (Drupal.jsEnabled) {
  $(document).ready(function($) {
    $('div.fivestar-form-item').rating();
    $('input.fivestar-submit').hide();
  });
}

This all seems to work fine now. So glad this is working now.

Site can be found at Red Eye Review

 
 

Drupal is a registered trademark of Dries Buytaert.