0

I am using CakeDC ratings to make a star rating in my site. I managed to make it work but it is displaying radio choices. I really wanted it to be a 5-star like functionality. In their documentation they tell that it is possible to use Jquery.ui.stars to make it work, but I think I will spend a lot of time trying to.

Does anyone know or have a sample code (php, script, css and html) that make this functionality using that Ratings plugin?

Ricardo Alamino
  • 749
  • 1
  • 5
  • 11

1 Answers1

3

You did see the js/css folders in webroot, right? https://github.com/CakeDC/ratings/tree/master/webroot

They do serve a higher purpose. What you want is actually already part of the plugin and automatically enabled if you include the stylesheet and the javascript file...

So, just include the scripts + jquery. Done. Whats the issue?

mark
  • 21,691
  • 3
  • 49
  • 71
  • Well. I just see radios everywhere... I added the plugin this way: `.$this->Rating->display(array( 'item' => $article['Article']['id'], 'type' => 'radio', 'stars' => 5, 'value' => $article['Article']['rating'], 'createForm' => array('url' => array_merge($this->passedArgs, array('rate' => $article['Article']['id'], 'redirect' => true)))),array('style' =>'float:left', ))` The css and js are in the right place... – Ricardo Alamino May 22 '13 at 02:22
  • It internally renders `starForm()`, so it usually does display the stars. Debug your code using Firefox+Firebug. This will reveal your JS issues. – mark May 22 '13 at 08:39
  • Thank you... I will do it and I tell you the results. – Ricardo Alamino May 22 '13 at 13:44
  • Hi. I managed to do that works. I had some minor problems such as wrong path to js and css. But the most important was that I was not using the js to stylize: `$('#ratingform').stars({ split:2, cancelShow:false, callback: function(ui, type, value) { ui.$form.submit(); } });` – Ricardo Alamino May 24 '13 at 11:26