By zuessh on
hello, i am sure this has been covered many times and i have searched but have been unable to locate any specific information on this. I would like for users to be able to search for content based on its fivestar rating. For example, i have a recipe site that has pizza and apple pie categories. Under each of the categories people post their own recipes for other users to try. I would like for users to be able to search for the highest rated pizza/pie recipe. What is the best way to accomplish this and is there specific documentation on doing this? Thanks in advance.
Comments
I know this will
I know this will accomplished through the views module. Anyone ?
Content filtered by Type and sorted by User Rating
Zuessh contacted me because he saw this thread: http://drupal.org/node/218148
I demonstrated this functionality at http://www.socialsustenance.org/view/idea_list_rating
Then I provided this step-by-step. If anyone else has the same questions, I hope it explains things clearly enough. If anyone else wishes to support step-by-step instructions or is interested in other Drupal services, reach me through my contact form: http://drupal.org/user/218408/contact
Creating a View Filtered by Content Type andsorted by User Rating
Login to an account with the “Administer Views”
permission.
Navigate to drupal_root/admin/build/views/add
In the “Basic Information” section
Give your new view an appropriate name, such as
“recipes_sorted_by_vote”
Choose which roles will have access to this view (nothing
checked=everyone has access)
In the “Page” section
Check “Provide Page View”
Enter an appropriate URL, such as
“view/recipes_sorted_by_vote”
Select the View Type you want to display to your user. You
probably want “teaser.”
Enter an appropriate title for the page, such as “Recipes
Sorted by User Rating”
Customize the page that will be displayed by altering the
“Nodes per Page”, “Header”, “Footer”, and “Empty
Text” fields.
If you wish to automatically generate a menu item, edit the
fields in the “Menu” section.
It doesn't sound like you want a Block for this view, so I
will ignore this section. If you set this up, I recommend View Type
“List” and you must configure the Fields section.
If you selected “List” or “Table” as a View Type in
4.3, select the Content Type fields that you wish to display. You
would probably only want “Node:Title”
Skip to Filters. Add a filter for “Node:Published” and
confirm that ”Yes” is selected.
Add a filter for “Node:Type” and select “Page”.
Skip to Sort Criteria. Add VotingAPI percent vote vote.
Change order to descending.
Choose Save, then navigate to the URL you defined in step
4.2.
Hey Mathew Petty
Can you please update these instructions for use with Drupal 6? These instructions look different to what I'm seeing in the Views section of my Drupal 6 install.
I've installed Drupal 5.7 so
I've installed Drupal 5.7 so I can follow the above instructions.
How do I use this view in by categories?
Your instructions create a new page or block, not a way to sort nodes with an existing category, from what I can tell.
eg.
Car website -> Category is Audi -> A4, A6, A8 nodes sorted not by most recent, but by highest rated.
Shouldn't be too hard?
No...
I don't think you understand what the Views module does. You should use views to create a page (or block) that shows all nodes in the "Audi" category that are published and sort the list by highest rated.
Follow the instructions, except instead of filtering by Node: Type, filter by category.
Ok, when I set the view's
Ok, when I set the view's URL to taxonomy/term/1 it appears to work. How does the view handle multiple pages?
Eg. I set it to 10 per pages, does that creat multiple pages?