blog

archives

Improved Polls in Discourse

Jeff Atwood August 21, 2015

Polls just got a lot better as of our most recent Discourse 1.3 release! To add a poll to any post, just follow these easy examples:

Single Choice Poll

[poll]
- Apples
- Oranges
- Pears
[/poll]

Multiple Choice Poll

[poll type=multiple]
- Apples
- Oranges
- Pears
[/poll]

Multiple Choice Limited Option Poll

[poll type=multiple min=1 max=2]
- Apples
- Oranges
- Pears
[/poll]

Number Rating Poll

[poll type=number min=1 max=4]
[/poll]

Named Polls

To include several polls in the same post, simply give each poll a name:

[poll name=fruits]
- Apples :apple:
- Oranges :tangerine:
- Pears :pear:
[/poll]

The post owner (or a staff member) can close a poll any time. After the poll is closed (or if you press the Show Results button) you can view the current poll results in graph form:

There are a few other features we want to get to in the future:

  • Show who voted in a poll
  • Auto-close polls after a certain time (or number of votes)
  • Secret polls where results aren’t visible until the poll closes

Try it out in our sandbox and see what you think!

Notable Replies

  1. Great, just one question. Is it possible to make the poll sticky AND only sitcky to those who have not voted ?

  2. We'll be removing the name since it's only used internally to differentiate between polls in the same post.

  3. says:

    @tgxworld @codinghorror Unfortunately it appears that the poll PRs you've merged have broken the ability to use images as poll items :sadpanda: (Scroll up to see the previous posts, they were were correctly before)

  4. Doesn't seem like the text color of polls inherits from the site's text color:

    Minor as it's easy to change in css in the meantime, but reporting all the same

Continue the discussion at meta.discourse.org

21 more replies