A few days ago, I compiled a list of all the node review modules I could find at the time, and wrote up an article comparing them: http://www.lullabot.com/articles/a_review_of_node_review_modules. The amount of overlap in these modules is, quite frankly, stunning. Yet they all do slightly different things. Node Review handles multiple axes. Simple Vote merely stores the aggregate score for a node. User Review allows you to place a comment with your vote. Vote Up/Down handles a simple "yes/no" style of voting.
It occurred to me that if we took a step back, we might be able to develop "one voting module to rule them all." Rather than having to keep implementing these new voting modules because others "almost" do what we want but not quite.
I've looked briefly at customvote.module, which looks as though it endeavors to be that tool. But I'm thinking something slightly different: a voting API field for CCK.
- I started down this track because I needed to implement Amazon-style reviews. So both a 1-5 "star" rating, as well as a "was this review helpful?" rating. None of the existing voting modules (that I could find anyway) did this. This meant implementing "yet another voting module" which greatly offended my sensibilities. ;)
- In reviewing all the node review modules, I was struck by how they're basically all exactly the same except for a few differeces in implementation details:
- Is the review stored as a node, or only a rating?
- What "scale" are they rated from? 1-10? 1-5? Yes/No?
- Is a user allowed to comment along with their vote, or does the system store just a rating?
- Is a user allowed to vote on one aspect of the thing, or several?
- Is the voting widget a series of stars that you click on? Buttons? A drop-down?
- Are the voting results displayed as a series of stars? A number? An arrow?
- Is only the overall rating displayed, or is the user's rating also displayed? Can you see what all users voted?
- An overwhelming amount of code in each of these modules is dedicated to customization; should the widget say "Share your opinion" or does it just say "Rating"? Should it output stars, numbers, or both?
If we could somehow extract these properties more generally, it would be extremely powerful.
CCK seems the perfect tool for this:
- Whether fields are called "Rating" or "Review" or "Your opinion" or whatever is completely customizable.
- Reviews could be stored as nodes, with multiple voting fields attached (rating for X node, and was this review helpful?)
- CCK has built-in Views support, making it simple to create listings of votes ordered by author name, chronologically, by rating, etc.
- We can define different input widget types and theme functions to handle the input/output of votes.
- We can use the "multiple values" property to store votes on different axes.
I have some very preliminary code uploaded to my sandbox. Note that this doesn't come even close to working in its current state. I'm throwing this up here in case others can help provide architectural advice as I wrap my brain around CCK, Views, and Voting API, and contribute ideas and possibly patches so we can stop going down this road of 5,000 voting modules that all do almost-but-not-quite the same thing.
Thanks in advance for any feedback. :)