1

I need a poll inside my content types.

Sometimes the users create an article and like to create a poll directly into the node they created. They don't want to create an extra poll with no connection to the original article.

So how can I get the poll functionality inside a different content type?

3
  • 1
    D7 provides a Poll module by default. You can enable it. – Sithu Dec 27 '12 at 3:04
  • I think I explained myself badly. I need to create multiple types of content they have in a field that allows to create a poll, as the content type module Poll. – Miguel Borges Dec 27 '12 at 14:32
  • Are you a site builder or a developer? Would you mind writing some line of code and having a lightweight module that does the job? – Alexar Dec 19 '15 at 14:21
1

Possible solution 1: The Pollfield module seems to be a good starting point. This should do what you need for Drupal 6. However, it might not be a stable solution for Drupal 7.

Possible solution 2: It seems the Poll Improved module might be fit your requirements seeing that provides a field for polls. Though it also doesn't have a stable D7 release.

They don't want to create an extra poll with no connection to the original article.

You can use references (or entityreference) to have your article nodes reference a poll node. Though that would require another step for your content creators.

1
1

Another solution:

  1. Add reference field from Article node to Poll node,
  2. Use inline entity form to allow users adding Polls when adding/editing Articles
1
1

Another way might be to add some fields to content-type comments and use drupal chart to render the aggregated results as a pie chart or whatever...

  • pros: rather simple solution, based on stable modules and core;
  • cons: poor management.
0

Creating a new content type

Make sure you installed and enabled pollfield module correctly before you try to do the following.

  1. Go to Administer->Content Management -> Content types -> Add Content type (system path: admin/content/types/add)
  2. Enter a name: Poll
  3. And a type: poll
  4. Submission form settings -> change "Title" field label to “Question”
  5. If you like, you can also change the label of the body field
  6. The other settings can be left as they are
  7. Save!
  8. On the next screen (system path: admin/content/types) locate the Poll content type and click on its edit link.
  9. Adding the actual pollfield: Locate the “Add” area to find “New field” -> Label: Poll, fieldname: poll, field type: pollfield, widget: leave as is-> SAVE
  10. Pollfield settings: explained at Pollfield book IMPORTANT: “Global settings”-> required (so that you cannot accidently create a poll node without an actual poll)

  11. SAVE!

You have just created an independent content type for polls. You may customize it by adding other fields. Do not forget that you can control the display settings at system path: admin/content/node-type/poll/display.

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.