I've installed the latest fivestar. I have a view on my homepage that iterates over nodes and displays the full body content. The rating widget appears but it's not the dynamic version. Is this normal behavior or is it supposed to show the GUI "stars" version? I do see the stars within the node however.

You can see it on the homepage...
http://www.olpcusers.com

Comments

quicksketch’s picture

Status: Active » Closed (duplicate)

This looks like a duplicate of http://drupal.org/node/226414. There's a patch there that adds the ability to have a clickable widget in views rather than just the static versions. Additional reviews of the functionality would be welcome.

jrabeemer’s picture

Version: 5.x-1.11-beta4 » 5.x-1.12
Status: Closed (duplicate) » Active

I fixed the problem. On olpcusers.com, I'm using an inline views_build_view() in my page-front.tpl.php to display my view. My view is displaying FULL body content in each node view so it also displays code for fivestar. I'm not embedding any VotingAPI fields. But fivestar's libraries aren't being called on the homepage but they do load on a node. So I manually added the following to my page-front.tpl.php header.

<link rel="stylesheet" href="/sites/all/modules/fivestar/css/fivestar.css" type="text/css" />
<style type="text/css" media="all">@import "/files/fivestar/oxygen/oxygen.css";</style>
<script type="text/javascript" src="/sites/all/modules/fivestar/js/fivestar.js"></script>
<script type="text/javascript">Drupal.extend({ settings: { "fivestar": { "titleUser": "Your rating: ", "titleAverage": "Average: ", "feedbackSavingVote": "Saving your vote...", "feedbackVoteSaved": "Your vote has been saved.", "feedbackDeletingVote": "Deleting your vote...", "feedbackVoteDeleted": "Your vote has been deleted." } } });</script>

Not a clean solution unfortunately.

quicksketch’s picture

Hmm, I wonder if this is some kind of caching by views that prevents javascript and CSS from being added to the page.

You can do a much cleaner fix by adding

fivestar_add_css();
fivestar_add_js();

Which will add all the necessary CSS and JS.

quicksketch’s picture

Status: Active » Closed (fixed)