Closed (works as designed)
Project:
Star Rating
Version:
7.x-1.x-dev
Component:
Documentation
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
6 Apr 2012 at 12:18 UTC
Updated:
27 Mar 2014 at 16:41 UTC
Jump to comment: Most recent
Comments
Comment #1
Anonymous (not verified) commentedThat should be possible by using a reaction rule (Rules module). Wenn saving a node, you could calculate the average and set the summary field. It might be tricky to hide the summary field during editing, though. For hiding the field, two modules come to my mind: Display Suite and Hidden Field Widgets. There could be other ways of hiding the summary field.
This approach needs some elaboration. I'm about to implement a similar thing and will try to provide an update soon.
Comment #2
Anonymous (not verified) commentedThe procedure of #1 works. It's a bit tricky though, and should be documented somewhere with screenshots. I try to provide the required information here.
You'll need the latest dev version of Rules (because of the new type conversion actions) and the Hidden Field Widgets.
These are the steps:
- Set up the content type. All rating fields should be of type integer.
- For the overall rating, set the widget type "server side only" (to hide it from the form)
- Create a reaction rule to be invoked "before saving a node"
The rule config requires adding up the ratings in several steps, pseudocode:
This will get even longer, if you need to get the average of more than 3 rating fields.
The Rules config for 3 ratings looks like:
Rule config:
Comment #3
marcoka commentedif you try to do a real rating system, just use the "rate" module
https://drupal.org/project/rate
Comment #4
marcoka commented