Home

Lullabot

Lullabot Ideas

We know stuff. We empower you to know stuff too.

On Site Drupal Training

We'll come to you! Graduate from your own on-site courses and become Drupalistas!

Building Views with Fivestar and VotingAPI

Video by Nate HaugSeptember 30, 2008 - 2:15am

This videocast covers three modules, wrapped together to provide a flexible solution for displaying information about content ratings in a list.

VotingAPI: Central storage of votes and rating information.
Fivestar: A flexible widget for registering votes on a 1-10 star basis.
Views: The ultimate Drupal query builder, capable of pulling out lists of information from the database.

In Drupal 6, the options in configuring views has become drastically more complex. This videocast helps understand how to setup views that display information about the current average rating for piece of content and also how to pull in an individual users results, each displayed as Fivestar widgets.

Comments

Robert Carr (not verified) on September 30, 2008 - 11:55am

Nice tutorial

Nate

Awesome stuff. I'm finally on the way to Views nirvana, so thanks for this really neat presentation

merlinofchaos (not verified) on September 30, 2008 - 1:24pm

Fixing the preview problem...

<?php
function fivestar_init() {
  if (
arg(0) == 'admin' && arg(1) == 'build' && arg(2) == 'views' && arg(3) == 'edit')) {
    ...
add css here...
  }
}
?>

Mark Jarrell (attheshow) (not verified) on October 2, 2008 - 1:51pm

Great Tutorial!

Thanks for showing us this, Nate. I'm pretty sure I'll be doing this in a site very soon, and this was extremely helpful.

TUc (not verified) on October 6, 2008 - 3:50pm

Voting API arguments

Hi Nate,
Thanks for the great videocast. These stuff is really needed to level up a lot of people's understanding about Views.
I have a question, though. I wondered of it would be possible to have UID's as arguments for your view, so that you could filter on the individual nodes that were cast.

Assume our view is displayed on the path "votes". The path "votes/2" would give the table that you made, but only displaying the votes of the user with UID 2.

Voting API doesn't seem to introduce arguments by itself. But is a work-around possible?

Thanks,
TUc

Tony (not verified) on October 10, 2008 - 8:23pm

I need help to open this MP4 video.

HI, all,
I tried to open this mp4 video using QuickTime and Realplayer. I can listen but I failed to watch this video clip.
Do you have the same problem?

Thanks for helping me out.
Tony

Tony (not verified) on October 10, 2008 - 8:23pm

I need help to open this MP4 video.

HI, all,
I tried to open this mp4 video using QuickTime and Realplayer. I can listen but I failed to watch this video clip.
Do you have the same problem?

Thanks for helping me out.
Tony

Ron (not verified) on October 24, 2008 - 6:33pm

Two for One

Two great tutorials in one Views and 5 Star.

I been struggling with views for D6, you have just solved two problems for me.

Thanks very much

Ron

Lars (not verified) on October 26, 2008 - 12:52pm

The video is not playing in full....

The video stops after 1/4 of it's full length. Please, I need to se the whole thing...

Lars

theamoeba (not verified) on October 27, 2008 - 5:19am

great screencast - just one

great screencast - just one problem, i do not see the node relationship when i am creating the view. It does not show up in the filter list. I have followed the instructions carefully and have looked for modules that may be missing, but all seems right. I am running on drupal 6.5. views 2, voting api/fivestar (latest).

please help.

thanks

theamoeba (not verified) on October 27, 2008 - 7:02am

nevermind. i figured that i

nevermind. i figured that i needed to use views2 rc2.0 +

chrisindallas (not verified) on November 3, 2008 - 10:52pm

Views showing each individual vote when logged out

When I am logged in, everything is working just like the tutorial, but when I log out and go to the page generated by the view, or if an anonymous user visits the site, every individual vote is shown. The votes are grouped together by the title, and the order seems correct, but instead of just showing the average, every vote is shown. This seems to be the same whether I use "Voting Results" or "Individual Votes" relationship. Any ideas?

Johan Nyberg (not verified) on March 23, 2009 - 4:28am

Same problem

I have the exact same problem, when logged out, I get duplicates of the rated content. AND also the "My rating" column, i.e. the column where the user can rate the content, is already pre-populated with a rating! I guess this has to do with having multiple uid's with the value 0 in the db.

Anyone has a solution for this?

Johan Nyberg (not verified) on March 23, 2009 - 4:31am

Same problem

I have the exact same problem, when logged out, I get duplicates of the rated content. AND also the "My rating" column, i.e. the column where the user can rate the content, is already pre-populated with a rating! I guess this has to do with having multiple uid's with the value 0 in the db.

Anyone has a solution for this?

BassKozz (not verified) on September 29, 2009 - 11:07pm

Ditto...

Same problem here, I guess there isn't a solution :(

DeGon (not verified) on October 27, 2009 - 5:54am

duplicate node after voting (Fivestar)

Had the same Problem. This helped me withour patching: http://drupal.org/node/372626

BassKozz (not verified) on September 30, 2009 - 1:42pm

Patched by quicksketch...

There is a patch that fixes this issue: http://drupal.org/node/592312

tomrenner (not verified) on November 6, 2008 - 10:35am

Thanks for this post

...don't know for how many hours I've been struggling without a relationship. Thanks for making things so clear so easily! Cheers!

Web Addict (not verified) on November 7, 2008 - 1:06pm

You saved my life!!!!

I was seriously going mad trying to weed through the new Views interface to get the votingapi and Fivestar to do their thing. It's crazy that something as simple as mentioning that you now need to create a relationship for this to fall into place wasn't. I'm sure there are plenty of people just like me trying to scan through the 50 billion useless, outdated and repetitive posts gather by Drupal.org search.

Anyway thank you so much for clearing this all up for me. Maybe there should be some way to tie amazingly enlightening videos like yours to the module project pages on Drupal.org and vise-versa. I'm sure the support requests would drop substantially and create more confident webmasters more willing to dive deeper into Drupal .

Noyz (not verified) on November 8, 2008 - 11:46pm

great tutorial

This is will please so many readers. Thanks for it.

shubha (not verified) on November 21, 2008 - 12:01am

video is not playing full

The video stops after 1/4 of it's full length. Please, I need to see the whole thing...

Sebastien (not verified) on November 27, 2008 - 7:22am

Great tutorial

Many thanks, really clear, helpful and time saving!

brain2xml (not verified) on December 9, 2008 - 12:21am

Great! Thanks for this! But

Great! Thanks for this!
But one more question, what if I want to show results not in stars? I wana show result in a poins (like 3.5, 3) like in view editing page, how to do this?

shane (not verified) on January 22, 2009 - 6:08pm

Views fields - seperate your vote and average vote

I would like to separate the tally for "your vote" and "average vote + number of votes" into separate fields in views. Any idea how to do that?

shane (not verified) on January 26, 2009 - 12:05pm

listing of everyone who voted, and what they voted

To add to this previous request, how can we get a listing of everyone who voted and what they voted?

In my case, it is for a spreadsheet where a small group of people are rating applications to a conference workshop. I want to know what everyone voted, not just the average.

Luke (not verified) on February 5, 2009 - 8:33am

A big thanks from the UK

Hi,

Just wanted to say a big thanks to Nate, Addison, Kent (And the rest of the team) for providing the videocasts.

I am just about to start on my second drupal site and your tutorials are proving invaluble.

Thanks again

Luke

Dwarg (not verified) on February 6, 2009 - 2:52pm

Thanks for this

I just wanted to say thanks for this screencast. I finally got around to watching and it makes Views so much clearer.

I'm reading Using Drupal right now and it's exactly the Drupal book I've been waiting for as well. These kind of examples are the perfect way to help people unlock Drupal.

Thanks again!

Anonymous (not verified) on February 18, 2009 - 6:02am

Great tutorial and all was

Great tutorial and all was perfect until I created a View with filters, but when a filter is used the filter results do no show the stars of Fivestar as the initial page does, just the non css widget? Why is this? Thanks

Anonymous (not verified) on February 19, 2009 - 8:19am

Turn off Use Ajax

The error was caused by the Use AJAX on the basic setings being, on, turning it off and the stars where there

Bob (not verified) on February 24, 2009 - 5:54pm

QT stopped

i downloaded latest version of QT for windows but the video also froze quarter of a way through.

Anonymous (not verified) on March 23, 2009 - 12:09am

Great tutorial

Just wanted to say, this was a great tutorial, helped me get exactly what i as after, great job and thanks a lot!!

Ben.

Anonymous (not verified) on April 10, 2009 - 8:34pm

Fantastic, thanks!

As a Drupal newbie - just a few weeks in - there's no way I could have figured out all these details on my own. I was pretty frustrated that the rating didn't show up in my view after following a simple procedure that I had thought would work. (This turned out to be way more complicated than I would have ever dreamed.) After following your step-by-step procedure, though, mine works great - thanks a bunch!

Grant

nir (not verified) on April 14, 2009 - 6:25am

Great no-nonsense videocast

and the 'using Drupal' book is great. I'd love to see volume 2 of this book with more test cases.

myrto (not verified) on April 21, 2009 - 12:17pm

suppose I am not a windows

suppose I am not a windows or a mac user.
there is no actual way to see this video without losing 2 hours of my life trying to figure out how, right?

anyway... thank god my MOTHER has a computer that runs WINDOWS otherwise I would kill myself.

seriously, you guys have the most precious tutorials and the worst way to serve them...

it's a pitty.

m.

Dom (not verified) on April 24, 2009 - 8:29pm

This is just what i was

This is just what i was looking for! GREAT tutorial, thanks for the help!!

Anonymous (not verified) on May 7, 2009 - 11:35am

List of recent revies of certain node types

I am struggling to build a recent reviews view.

I am trying to clone the default recent/comments view, and then limit the noe types to

hotel, school., and add the fivestar widget.

see this picture http://i44.tinypic.com/2dl28h2.jpg

Thank you

dellis (not verified) on June 23, 2009 - 7:53am

Many Thanks!

this was great. Thanks so much!

Dave (not verified) on August 12, 2009 - 10:24am

Just the job

Really useful.

Anonymous (not verified) on August 20, 2009 - 12:00am

Great stuff, I 've being searching forever before here...

Great stuff, I 've being searching forever before here... Thanks so much

Anonymous (not verified) on August 26, 2009 - 12:21pm

Thanks for this very helpful

Thanks for this very helpful tutorial! It was just what I needed.

Anonymous (not verified) on September 17, 2009 - 6:58pm

Great tutorial

This was really helpful. I was able to add this feature to my website. Thanks!

james (not verified) on October 22, 2009 - 10:31pm

Thank you

Just another note of thanks - this was exactly what I was looking for, and couldn't be easier to follow. Lullabot rocks!

sasi (not verified) on October 27, 2009 - 9:15am

rated values are not saved

hi nate,

thanks a lot for this screenshot.its simply superb.this is what i am searching for.it really solved my problem.

i have made a "top rated" page as you described in the vedio, but the problem is that when a user rates a content in "my rating" option it is not saved to "average rating" option as a result "average rating" values remains same as before.so is there any way to fix this.

-regards,
sasi

air compressor (not verified) on November 11, 2009 - 2:21am

thanks a lot for this

thanks a lot for this screenshot.its simply superb.this is what i am searching for.it really solved my problem.

Joshua Needham (not verified) on November 14, 2009 - 2:36pm

Super Slick!

I wondered if this could be implemented and I found my answer with a video tutorial here. Nice work and great screencast. Really helped and now I have a FiveStar rating on my homepage graphical view of completed iPhone application projects.

Super Cool!

THANKS......

Sincerely,
Joshua Needham
App Ventures, LLC
@iPhoneDevForum

zdeno (not verified) on November 17, 2009 - 9:04am

fivestars layot problem

Hi. I have one small problem...I have lost maybe week of my life to find solution via CSS, but without success...Please, go to http://www.liska-studio.sk/galeria/various and try to "hover" over fivestar widgets...they will damage whole column layout and move it...maybe it is trivial bug that can be fixed wit some CSS editation, but I can not find out how....

Anil (not verified) on November 18, 2009 - 3:01am

Nice video..... :-)

Nice video..... :-)

Recent

Drupal Voices 160: Moshe Weitzman on Page Rendering in Drupal 7

Podcast 9.02.2010

Drupal Voices 159: John Albin Wilkins on Drupal 7 Theming

Podcast 9.01.2010

Drupal Voices 158: Emma Jane Hogbin on PHP for Designers

Podcast 8.31.2010

Command Line Basics: More Editing with Vi/Vim

Video 8.31.2010

Lullabot's Back to School Sale

Blog 8.30.2010

Popular

Drupal Voices 159: John Albin Wilkins on Drupal 7 Theming

Podcast 9.01.2010

Drupal Voices 160: Moshe Weitzman on Page Rendering in Drupal 7

Podcast 9.02.2010

Drupal Voices 158: Emma Jane Hogbin on PHP for Designers

Podcast 8.31.2010

Announcing BeautyTips, a jQuery Tooltip Plugin

Article 10.20.2008

Install a Local Web Server on Mac OSX

Video 7.15.2007
 
  • Home
  • Services
  • Events
  • Ideas
  • Store

Connect the Bots:

Twitter Facebook YouTube blip.tv All Posts Newsletter
  • Ideas
  • Blog
  • Podcasts
  • Videos
  • About
  • Contact
  • Jobs
  • Services
    • Training
  • Events
    • Training Workshops
    • Other Events
    • Conferences
    • Calendar
  • Products
    • Videos
    • Books
    • Swag
  • Ideas
    • Blog
    • Podcast
    • Videos
  • About
    • Philosophy
    • Team
    • Presskit
  • Contact
    • General
    • Work Inquiries
    • Mailing List