Closed (outdated)
Project:
Rate
Version:
7.x-1.2
Component:
Code
Priority:
Major
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
28 Oct 2011 at 13:45 UTC
Updated:
18 Sep 2025 at 12:11 UTC
Jump to comment: Most recent
I find the features on this Rate module a lot more robust and has better icons than the Fivestar module.
I have a little problem at the moment. I need to be able to add the ratings of a node to a View, which lists node in order of popularity. This module says it has Views integration but i cant not seem to work out how to add this.
The Fivestar module does this by adding a field in the content type and then this can be configured in a View. But there a still a few errors on the latest commit. So i can't use this module
Does anyone have a solution so i can use this Rate module in a View?
| Comment | File | Size | Author |
|---|---|---|---|
| rate-views-example.png | 38.1 KB | iamcurio |
Comments
Comment #1
mauritsl commentedThe readme file has more information on the views integration, does that help you?
6. Views integration
--------------------------------------------------------------------------------
This module provides views integration via the VotingAPI module. To add a rate
widget in your view, first add a relation to "Node: Vote results" for nodes or
"Comment: Vote results" for comments. You have to configure a few options here.
The "Value type" and "Vote tag" needs to be the same as used for the widget
(see §2.1). The "aggregate" function must be "Number of votes".
After adding the relationship, you can add the field "Vote results: Value" to
your view. In the "Appearance" box you may choose one of the following:
* Rate widget (display only)
This shows a disabled widget. Uses are allowed to see the results, but cannot
click the buttons.
* Rate widget (compact)
This shows a compact widget. This is the basic widget without the textual
information.
* Rate widget
This shows the full widget (as on the node page).
When using a view on nodes, you are advised to add the "Node: Type" field to
your view fields. If you do not, an additional query will be executed per row.
You may exclude this field from display.
Comment #2
iamcurio commentedJust had a look at the readme file in regards to the views integration and it has worked like a dream. Even sorting node content by ratings is working correctly. Thanks.
Comment #3
dweade commentedI've read quite a bit on creating a view from the rate values, but just can't get it to work. I'm new to the process and am only assuming "first add a relation to "Node: Vote results" for nodes or "Comment: Vote results" for comments" means these options (Node: Vote results) would how up in the Add Fields list. Nowhere do I get an option to select either of these in order to create a view that would sort nodes via their best/worst ratings.
Am I misunderstanding the location of the relationship? Or, do I need to enable something in order to have these relationships appear?
Thanks
Comment #4
kufeiko commentedI think this issue is the place for my problem...
I can't seem to find 'Comments: votes' relationship in 7.x-1.2. It is there with Drupal 6 and 6.x-1.3. Any guesses?
Comment #5
Frogtown commentedJust piggybacking off of this -- I followed the directions here, and looked at the README.txt, I was able to populate a view with a list of my image content types, and so it shows the Five Star -- but as is notated within the 'Add Widget' section 'Interaction': "Note that these settings do not apply for rate widgets inside views. Widgets in views will display the average voting when a relationship to the voting results is used and the users vote in case of a relationship to the votes"
Since I'm going to be populating my front page using Views here to propagate the content. Are there any plans to allow the settings, such as 'Users vote if available, empty otherwise' or 'Users vote if available, average otherwise' --- It's a tad confusing that when the rating is clicked, it just shows the average -- it's not apparent that the user's vote was accepted -- so I'm thinking it seems like the end user would think the voting isn't functioning. If this isn't going to be made available to views, does anyone know if there's some method I'm missing here where it can possibly echo some text like 'Thanks for Voting' or whatever, to populate once a vote has been submitted?
Comment #6
OldAccount commentedThanks mauritsl, worked perfectly, somehow I always forget to check the readme files. :)
Comment #7
FAAREIA commentedIf your widget is not shown, check if you have the title field with link option, or any field from that node. If your Vote field is the only one in your view, widget will not appear.
Comment #8
thommyboy commentedjust in case someone wants to achieve #5 i think i found a solution. instead of using the views-field for the rate- just insert any field (like nid) to the view, add a custom template for that field containing:
$nid = $row->nid;
print rate_generate_widget(YOUR_WIDGET_NUMBER_HERE, "node", $nid);
Comment #9
ivnishDrupal 7 is EOL. Issue will be closed