Right now Voting Field isn't much good reviewing on it's own node. Each rating submitted reviews the node the rating exists on, which I don't think is the desired task. Say you have a review content-type, you'd want the review to point to another piece of content, not rating the written review itself. Another field needs to be added for target node.
I've attached a patch to get started... it doesn't do anything other than add the interface elements to the field form. Since this module doesn't yet save content I couldn't go much further, but it's a start.
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | votingapi_field_target.txt | 2.34 KB | quicksketch |
Comments
Comment #1
quicksketchAnd the patch.
Comment #2
dfletcher commentedI think I have a better route here, rather than re-inventing a way to attach nodes. The idea is to be aware of and work closely with nodereference in order to provide all voting data to the related node upon load. Nodereference has a far better user interface and has nifty Views support. I will open a new issue "nodereference support" shortly.
If you really need a way to use PHP code to provide this relationship, perhaps I could add module hooks. I don't know what they would need to look like though and it's not a high priority. Feel free to open a separate issue if you want.
Comment #3
quicksketchNodereference is a good idea, and I think it would be helpful to integrate. However, I believe PHP code for the 'target' of the review is MUCH more important. When would you really create a content type which could only rate exactly one node? If you were running an amazon-like review system, you'd need to create a new content type for every product! Of course you really could hook_form_alter on the nodereference field and put in the nid you really need to reference dynamically, but it would have been much easier to just include PHP code in the first place.
Comment #4
dfletcher commentedI don't understand what you mean that you would need to create a new content type for each node. Nodereference lets you pick a related node when you create instances. It is not about embedding one node per content type (which IMO would not make any sense). What it does is let the node author pick the relationship and gives the CCK administrator very good control over what types of nodes will appear for the node author.