Multi-axis Review System using Fivestar with Views atach & node reference URL widget Implementation for Drupal 7

I've struggled to make it work on drupal 7, finally its working now , so here is tutorial for creating Movie review site (assuming you want to show more than two voting axis) :

Required modules
• Fivestar (dependancies: Voting API) ;
• CCK ;
• References( for drupal 6 Node Reference);
• Node Reference URL Widget
• Views (dependancies: Chaos tools).
• Eva ( For Drupal 6 Views Attach)

Step 1: Create the rating axis

Go to Configuration » Fivestar (admin/config/content/fivestar) and add as many axis you like in the "Voting tags section" i.e you can have Acting, Story, Photography, Music, Direction & finally Overall Rating etc

Step 2: Create the Movie node type using CCK and create a Movie

1. Create a new content type called "Movie" (I disabled the comments on the "Comment settings" tab because I want the reviews to replace the comments, but you don't have to).
(This is applicable only for Drupal 6 Five Star, if you are using Drupal 7 then directly Go to Step 2 Else Edit the content type and under the Fivestar voting tab, make sure the "Enable Fivestar rating for the "your_axis" tag" is checked for each axis you need.
This is important because votes made by the Review content type will not be calculated unless this box is checked)

2. Now go to Manage Fields and add new Five star Field as ‘Acting’ and select ‘stars( rated while viewing)’ as widget style. Click on Save once, now in field setting Select ‘Acting’ as Voting Tag and click on Save, click on save settings to save the field settings.
3. Now go to Mange Display Select "Hidden" under "Teaser Display" and in "Full node display leave field format as “As Stars” for ‘Acting’ Field, we need to later come back here and adjust few parameters.
Repeat this settings for each axis you need like story, photography etc.
4. Save this content type
5. Create a Movie node titled "Movie A". Note the URL of this node as you will need to come back to it later.

Step 3: Create the Review node type with multiple rating fields using CCK and create a Review node

1. Create a new content type called "Review".
2. Click on Save and add fields.
3. Add a node reference field.
1. Set the label to "Select the Movie you wish to review".
2. Set field name to "Movie_reference".
3. Select "Node reference" as the field type.
4. In Widget “Select Reference from URL and click on Continue, click on “Use select list widget” in Fallback behavior. In Link title & Link hover title give title as “Add Review” ( This is very useful to displays as ‘Add Reviews’ in Movie content type.
5. Choose ‘The Referenced node’ in Return path

6. Save the field.
7. Check the "Movie" node type under "Content types that can be referenced".
8. Save the field settings.
9. Make the field a required field.
10. Save the field.

4. Add a Fivestar rating field( you can re-use the fields which you created in Movie content type).

1. Set the label "Acting".
2. Set field name "acting".
3. Select "Fivestar rating" as the field type and choose “Stars (rated while editing)” as widget. This is important otherwise you wont see “Voting target” field.
4. Under "Voting target" select the node reference field "field_movie_reference".
5. Under voting tag, choose "acting".
6. Save the field settings.
7. Make the field a required field.
8. Save the field settings.
9. Follow the same procedure for other categories like Music, Photography etc.

Now you can create a Review, enter a title, enter body text (optional), give it a rating, and select "Movie A" under "Select the movie you wish to review". Submit the review.

Step 4: Display the reviews on the movie page

No need with the use of the Views module for php code, here is the trick :
1. Add a new view (admin/structure/views/add).
1. Select the Movie type of content under the "Show" option.
2. Uncheck the Page option, click on “continue & edit " option.
3. now Click on Add button and select ‘Eva’ Field ( its also known as Entity content in Eva-1.x version)
4. Name it, say, "Users' review" (or anything you like).
5. Click on Entity Type and select ‘node’ as EVA field. This adds node display.
6. Click on Bundles and choose ‘Movie’ as bundle.
7. Add a new Contextual filter.
8.
9. Check "Content: Select the movie you wish to review (field_movie_reference)" and click on "Add and configure…".
10. Choose "Hide View" in When the Filter value is Not Available and press apply.
11. Leave the Argument field as ‘id’.
12. Click on Relationship ‘add’ button and select “Content: Select the Movie you wish to review” and save it
13. Go to Filter Criteria and and select content:Type (=Review).
14. now go to Fields and add fields which you wanted to display, I choosed “content:Title, Content:Body( labeled as review) and Content : Overall( to display overall rating).
15. Set the number of items per page at the desired value.
16. Choose an Table list of full posts (or a grid or whatever, here I choose an Table list, without any links or comments).

17. Save by clicking on Apply.

18. Now go to content type ‘Movie” and check if field Eva: User Reviews –Eva Field as Visible or not, and save the content type once.

19. Now open the Movie content type again and go to manage display option and Select the “As Stars” for voting field ( e.g acting) and go to far right hand side of page and click on ‘wheel’ button make field setting like this “Style: default, Exposed: no, Stars display: average, Text display: none” ..repeat this step for other fields ( Music, Photography etc)

20. Click on Save to save the Content type display settings.

21. This step is useful to tell your block to load only the reviews linked with the movie, and not all the other reviews. You *may* have to toy with this option to suit your specific website settings.
22. Save the view.
2. Let's go and add review’s, now you should be able to see ‘add review’ link on Movie content , by clicking it you should be able to add the review, at least submit two reviews from different users for same movie, this is very important otherwise Five Star module doesn’t show the average of the reviews.

There you go, it worked for me, Any hints, further (and smarter) settings or feedback welcome !

Your rating: None Average: 3.1 (33 votes)

How do I make it so the user

How do I make it so the user who want to place a review just clicks a link on the 'movie' node, 'review this movie' , so the reviewer doesn't have to search for the movie to review?

Thanks for tutorial. How to

Thanks for tutorial.

How to limit a user to one review per node ?

Thanks

I think you can do it by

I think you can do it by checking the user reference condition, though i didn't try it personally.

-Mazhar

Hello, Thanks for this very

Hello,

Thanks for this very useful tutorial, but I I've one question. How would you create and display the average note on the movie node ?

For instance I have three axis votes on my movies reviews and I've been able to display each of them on the node following your tutorial. But I also need to display the global average note on the node, i.e. the average note from the average note of each review...

Any idea?

Thanks!

J.

hi J, sorry for the delay in

hi J,

sorry for the delay in the reply, not checking my site frequently :( ...

Am not clear about your question, do you mean displaying average votes on a node from N-number of review votes ? if yes then that is what we wanted to achieve with this tutorial...please let me if you wanted to display it on main move node using individual reviews node votes, then I can help you

-Mazhar