Active
Project:
VotingAPI Field
Version:
5.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Reporter:
Created:
7 Dec 2006 at 22:43 UTC
Updated:
26 Dec 2006 at 12:37 UTC
Support CCK node references by copying all voting data from the reviewed node into the referenced node upon node load.
Themers may then pick up the voting data from either node.
Comments
Comment #1
dfletcher commentedAfter quite a bit of discussion in IRC with eaton, quicksketch, and morphir, I believe we have a bit more work to do than simply copying the data to the referenced node.
The best example so far comes from quicksketch who has shown me a decent example of a comment based reviewing system.
From these discussions, I believe this can be supported in two ways:
Modules can implement this hook and return an array of other node IDs which must receive a copy of the vote. This hook might be implemented in votingapi_field itself in order to provide the functionality for nodereference.
Comment #2
dfletcher commentedPerhaps in addition to the noderef support above, we can also implement quicksketch's original idea of having a PHP input box for attaching node refs. Let's hide it under an "advanced" tab though.
Comment #3
morphir commentedI am not sure if the user who post the review/rating should figure out what node he are referring to. This should be automatically in some way.
I foresee when you surf your way to the parent node, you can rate that parent node in a review-article way.
Where your review/article automatically becomes the child node to the parent node that holds the average data/sum and what not.. This is something I foresee could be dealt with trough views module.
When it comes to choosing your parent node(from a user point of view) there will be a lot of categories and terms for the user to choose between. And I think that it becomes to difficult for the user to deal with so much decisions.
Category_browse is also needed module(that have not yet been made) which could be very handy for this purpose.
Comment #4
dfletcher commentedWhat I've described here is effectively the same as your parent/child idea except these things aren't exactly called "parent" and "child". The best names I've come up with so far is "referencing node" and "referenced node".
The nodereference support is just a simpler way for non-PHP users to have a way to pick this relationship at node creation time with a nice user interface.
Both the GUI (nodereference) and the non-GUI (PHP code) ways of doing this will both support a many-to-one relationship between one node and a set of relations. The idea behind the hook (and the PHP input box) is that you can use some code to attach a review to some other node, saving the author from having to do it each time. For example, if node based comments are attached to a "parent" node, some PHP code could specify that the comment is the users's single vote and the results must be aggregated on the "parent".
Comment #5
dfletcher commentedOne final feature that would make this whole thing much more useful is to have user and author versions of all 3 types of widgets. Currently there is only one author field called "Author Rating" which is very similar to the "User Score" but is controllable by node author. This should be repeated for the other two types, for a total of six possible widgets:
While I'm rearranging these perhaps I can make the "add field" page prettier by putting all the items in one group.
Comment #6
dfletcher commentedThere is a basic working version of this in CVS now. Nodereference is working, PHP hooks are working. There is no PHP input box yet.
There is no display of these referenced votes yet. Perhaps the solution is to define display-only voting fields that can be applied to the referenced node type (if it is CCK). These would display the aggregated value. Another possibility is to lookup and attach this data at node load time.
Comment #7
dfletcher commentedThe data is now available on $node objects during theming. It is added on hook_nodeapi, $op=='load'. There is no currently no way to display the data without a bit of code in a theme though. This needs improvement (obviously).
Comment #8
morphir commentedI agree. This is the solution.