Hello,
Just installed a website based on drupal 6.2 for a photographic contest.
I needed a way for my users to rate images uploaded using the image module, and installed fivestar and votingapi. Now I'd like to use vews to make a list of highest rated shots.
I read in the README that in Views I have to select "VotingAPI percent vote result" from the list of
available Fields, but this field simply isn't there, nor I find anything about fivestar or voting in the available fields... maybe I missed something, but what?
I'm using:
drupal 6.2
views 6.x-2.0-beta4
votingapi 7.x-2.0-beta6
fivestar 6.x-1.0-alpha2
| Comment | File | Size | Author |
|---|---|---|---|
| #32 | views_fivestar.png | 357.35 KB | jghyde |
| #15 | ScreenJot Cropped 09-09-2008 21 55 45.jpg | 39.27 KB | misterlawrence |
Comments
Comment #1
vm commentedvotingapi 7.x ? you should be using votingapi 6.x. please double check
Comment #2
quicksketchThe new Voting API (6.x-2.0-beta6) breaks the views integration with the current version of Fivestar. I'm releasing a new version soon. Until then, use the beta5 version: http://drupal.org/node/267356
The README also probably needs to be updated, as the field names have changed in Drupal 6.
Comment #3
drupaloSa commentedBeta6 allows to select the appearance of vote display via a select box. How can i do this in beta5? Is there a way to display stars instead of just the percent value?
Comment #4
drupaloSa commentedThe problem is partially solved by using 6.x-2.x-dev (8th July), however the display of ratings do not follow the settings made for that content type. I mean i have a custom node type which i can rate from 1 to 10 but the view uses stars from 1 to 5.
Comment #5
capellicI Need this, too. I took heed, backed out of beta6 and went for beta5. I see the following fields available but how do I display the little voting widget?
VOTING API RESULTS
Voting API results: Function - The aggregate function used to calculate the result.
Voting API results: Tag - An optional tag to group multi-criteria results.
Voting API results: Timestamp - The time the results were calculated.
Voting API results: Value - The value of an individual cast vote.
Voting API results: Value type - The nature of the results in question (points, percentage, etc).
VOTING API VOTES
Voting API votes: IP Address - The IP address of the user who cast the vote.
Voting API votes: Tag - An optional tag to group multi-criteria votes.
Voting API votes: Timestamp - The time the vote was cast.
Voting API votes: User - The user who cast the vote.
Voting API votes: Value - The value of an individual cast vote.
Voting API votes: Value type - The nature of the vote being cast (points, percentage, etc).
Comment #6
capellicI started to muck around in fivestar.module to see if I could pass in an ID and get the widget form back. was able to successfully implement a "ready only" version of the rating. In my views-view-fileds--vendors.tpl.php (where 'vendors') is my view name, I enter the following:
It returns the stars and "Your rating..." underneath.
I see that there is the following function:
But I don't know what to enter for $form_state. I gather that, in my case, $content_type will be 'node' and $content_id will be $fields['nid']->content.
Comment #7
drupaloSa commentedSo there isn't a way to display the correct configuration without custom theming the view?
Comment #8
capellicCheck out this post on this thread:
http://drupal.org/node/297635#comment-972021
You will see my followup comment stated some hesitation, but after I upgraded to beta6 and also upgraded to the most recent dev version of FiveStar (very important for avoiding an AJAX JS error), I followed his screenshot and it worked.
The latest version of FiveStar isn't available on the module page, instead you can get it here:
http://drupal.org/node/286329
Comment #9
drupaloSa commentedI'm already using the latest dev versions for both modules. My problem is that although i use a 10-star rating system, views displays a 5-star rating. Does this work for you?
Comment #10
capellicI haven't tried 10 stars - I am using 5 stars.
Comment #11
misterlawrence commentedI am happy to start my own thread if necessary, but I thought I would start by piggybacking on this one since it is such a similar issue (perhaps the solutions are also similar).
I am on Drupal 5.10, Fivestar 5.x-1.13 Voting API 5.x-1.6 and Views 5.x-1.6.
I have a table view of products (books, CDs, video games, etc.), and each one has been individually rated in Fivestar by users. Last year, I was able to display the Average Fivestar rating (in "stars") on each row of the table. I recently updated to the latest versions of all the code listed above, and now there are no Fivestar fields available for using in the table View.
Can anyone offer any suggestions?
Comment #12
quicksketchmisterlawrence: select "Voting API User Average" as the field, then choose "As Stars" as the display option. Fivestar moved from providing it's own Views integration to leveraging the code provided by VotingAPI.
Comment #13
misterlawrence commentedThanks quicksketch. That was really helpful!
Unfortunately, the closest field names are "Voting API Precent Vote User" or "Voting API Percent Vote Result (Average)". Neither seems to give the appropriate result. The first one does not have any data displayed (nor does it have any Fivestar options). The second one seems to show five stars for every listing (which is not correct data).
Any further ideas would be appreciated.
Thanks!
-David
Comment #14
misterlawrence commentedBump. Any help on the my question above would be appreciated. Thanks!
Comment #15
misterlawrence commentedFor clarity, I've attached a small jpg screenshot of the Views options that I have available for Voting API. Are any of these choices the correct one to use? If not, is there a different version of Fivestar or VotingAPI that I need to install?
Comment #16
virtualdrupal commentedI have the same issue, tried the latest DEV of votingAPI and of FIVESTAR, still nothing, the latest DEV of views seems to remove ALL votingapi options... Any ideas?
I'm basically switching to D5 at this point just because having fivestar work within a view is imperative for this project, however now D5 is proving to be just as troublesome, now views1 has the option for fivestar/clickable, but I can't figure out how to theme out the results :mad:. The D6 ability to setup a views-view-fields.tpl.php and theming each
print $fields['title']->content;of course isn't an option in D5 that I can find..
So unless fivestar becomes clickable within a views2 output, life isn't going so well :(
If anyone could please contact me when they have a few minutes I'd really appreciate it, I just keep going in circles
Comment #17
quicksketchViews2 recently changed it's API between RC2 and RC3 (sigh), so you'll need to update to the latest VotingAPI version to get everything working again.
Comment #18
quicksketchUse the latest versions of Fivestar, VotingAPI, and Views and things should be working again. To clarify, any of the following versions of these modules should work together:
VotingAPI: 2.0 RC1 or higher
Views: 2.0 RC2 or higher
Fivestar: 1.13 or higher
To get comfortable using Views in Drupal 6, this screencast should help: http://www.lullabot.com/videocast/building-views-fivestar-and-votingapi
Comment #19
meba commentedI can't confirm this. I am using:
VotingApi 2.0 rc1
Views 2.0 RC4
Fivestar 1.13
and no fields are in Views form
Comment #20
meba commentedPlease disregard my message, I didn't know it's relationship...
Comment #21
chasz commentedwhat is its relationship?
Comment #22
capellicIf you are familiar with MySQL, then a Relationship is a Join. It allows you to essentially relate another table to the table you are already looking in by a similar field (a key).
This screencast came out soon after I figured it out - it should answer a lot of questions:
http://www.lullabot.com/videocast/building-views-fivestar-and-votingapi
Comment #23
Lars69 commentedI have been trying to find my "Voting API field" for a frantic couple of days now. The above screencast will not play more than 1/4 of its length, and I can't find any other source of information on this subject than this thred. I'm using "quicksketch" req. versions of modules. Is it only me who can't se the full screencast?
(My problem is that I use views formated for tables output and can't make fivestar working, and I can't find the Voting API field...)
Comment #24
Lars69 commentedFound the answer learning about relationships in views. Very complicated but works. Thanx.
Again, all answers here:
http://skitch.com/eaton/u4xd/votingapi-relationship
Comment #25
justinchev commentedCheck out this post - I describe how I went about adding the 'Sort by 5 star' view for my site. Also had some problems when it came to the various releases of various modules. Once I had the 2 troublesome modules updated to the latest version all problems were resolved.
http://drupal.org/node/310310
Comment #26
quicksketchI've put the link to the Lullabot Screencast on the Project homepage. Hopefully this will reduce the confusion regarding creation of Views with Fivestar and VotingAPI. I think everyone's had their question answered, so I'm moving to fixed.
Comment #28
zenrei commentedI'm assuming because everything's upgraded, it all works differently, or not at all now?
Comment #29
zenrei commentedComment #30
vm commentedworks the same way
Comment #31
zenrei commentedI don't see how, because the entry names are different, and it's not pulling in the stars, only words.
I'll try again, from scratch, though.
Comment #32
jghyde commentedThe answer to include fivestar in views, without a screencast, is:
Thanks to @capellic for the link, http://skitch.com/eaton/u4xd/votingapi-relationship that explained it all for me (and gives you a graphic of these instructions), I attached a screenshot of my Views panel after configuring Fivestar module to show in the View.
Comment #33
gawas.sachin commentedAdd Fields-> voting Results -> Choose Appearance -> Default/Fivestar Text And You are done..!
Comment #34
SeanA commentedSetting to active because this is useful documentation, and it's not obvious how to get this working.
@jghyde: Thank you for the simple (text-based) explanation!
Comment #35
janroche commented@gawas.sachin I'm using the latest Drupal version 7.x I can't seem to find the how to use the default fivestar for the appearance. All it shows is digits instead of image stars. How do you easily show the image any ideas?I'm not searching
Comment #36
intelviji commentedI set up five star module in views successfully. by setting up a relationship with voting results. Now, It casts vote correctly. But, i want to reply "Thanks for Voting" after successful vote.
Comment #37
whiteph commentedSorry, Drupal 6 is end of life, and is no longer supported.
Comment #38
SeanA commentedActually, this was answered and can therefore be marked "fixed". See #32. I only re-opened it so others could find the answer easily.
Comment #39
whiteph commented@SeanA - thanks.