0

I have a content type that users can vote on so I need that content type to keep tally of the votes.

I'm assuming I need to allow the public to edit that content type but, unsure how to go about doing so.

I on the daily basis use web services on other projects and would just POST the data to the entry on click of a button or something. Is it a similar way just POST a change to the content type via ajax in drupal?

Sorry if this is a dumb question, majority of my skills are in front-end dev not server side so any help is appreciated.

1

I'm not sure I understand you correctly but let me clarify:
A.If you have a new content type that users can vote for that. You just use the votingapi http://drupal.org/project/votingapi and use with Fivestar module http://drupal.org/project/fivestar or plus1 module http://drupal.org/project/plus1. You will go to plus1 or fivestar for setting the content type that be voted.
B.To determine the total of the votes of your content type you should do following:

  1. Create a new view and choose the type of your content, remove sort options, fields and other default settings.
  2. Add a field for "Content: Type" Expand the "advanced" part on the right and set "Use aggregation" to "Yes"
  3. Create the relationships with votes table("Content: Votes")
  4. Add another field for "Content: Votes", click "Aggregation settings" and set the aggregation type to "count"
  5. The second "Content: Votes" should now look like " COUNT(Votes: Value)" and now you can see your content type and the total votes of that.

C. In order to anonymous users can edit your content type just go to permissions and set configuration for anonymous users.

| improve this answer | |
0

If the "edit" type you need is just for voting purpose, take a look to Flag module

| improve this answer | |
0

The Fivestar module allows voting permissions to be configured by role, including the anonymous role. The voting is tallied by the module, not in the content type being voted on, so the user does not need any permission but 'View Content'.

You should never give content edit privileges to an anonymous user. Requiring a user to log in before they are allowed to change information on your site is a basic security measure. If a user makes a change, you are able to attribute the change to the user. If the user does something unwanted, then you can deal with that user accordingly.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.