Each vote in the Voting API has the following attributes:
vote_id: sequential number assigned by voting api
content_type: "node" in our case
content_id: node id in our case
value: -1 or 1 in our case
value_type: points in our case
tag: normally "vote" in our case
uid/timestamp/vote_source: the user/time/IP of the voter
To make this module more flexible, it would be good if the system would support custom "tags", rather than just the value defined in the UI. In this way, you could attach multiple votable attributes to a single node, and distinguish between them using the tag field. EG: a node might have a multi-value field containing a shopping list - you could vote for items on the shopping list, not just the node itself.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | vote_up_down.custom-tag.patch | 7.48 KB | lyricnz |
| #1 | vote_up_down.custom-tag.patch | 7.04 KB | lyricnz |
Comments
Comment #1
lyricnz commentedHere is a patch that adds this support to the module, without changing the current behaviour. Adding support for customizing the *view* of these votes, is a job for another patch.
218 passes, 0 fails, 0 exceptions (no new tests added for this)
Comment #2
lyricnz commentedUpdated patch, fix places where $tag is not overridden.
TODO: make unique element IDs, update javascript doing updates by cid, add testcase, etc.
Comment #3
afox commentedOk, I believe this has been committed to the latest dev-release. At least the patch failed...
How can I use this to build a multi-attribute +1 voting?
I have stories, which have some defining tags (5-10). I'd like to have the users vote the attribute they choose and that way let the readers define the story.
Next logical step could be using taxonomy to build the votable attributes, eh?
Comment #4
marvil07 commentedI can confirm this is already applied, so closing this issue