How to Create Polls?

Hey Joe. Man, I’m TL3, so I think I can set up a poll, but I’ve looked, and I can’t find the code to do it. I thought I could edit my feedback page and just copy it from there, but I can’t.

Is there a template for adding a poll?

Thanks
:guitar:

3 Likes

@Guitarzan Go into the 3 line box on the top of a reply window, click the little gear and it should give you the option to setup a poll

4 Likes

Thanks man. I got it goin now. :grinning:
:guitar:

3 Likes

Are you satisfied with this explanation?

  • Yes
  • No

0 voters

3 Likes

I’m glad that you figured it out…

Enabling polls

Polls are enabled in Discourse by default. Site admins can disable polls in their community via the poll enabled site setting.

Site admins can further adjust who can create polls via the poll minimum trust level to create site setting.

Creating a poll

The easiest way to create a poll is to use the poll builder. The poll builder can be accessed from the :gear: in the topic composer, and allows you to make a poll without needing to know the exact syntax.

Poll Options

Type:

  • Single Choice: Default poll type. Users can select a single choice from the poll
  • Multiple Choice: Users can select multiple choices from the poll.
    • The poll creator must also define the minimum and maximum number of choices a user can make. By default the minimum will be 1, and the maximum will be the number of poll choices.
  • Number Rating: Users can select a single number.
    • The poll creator must also define the min, max and step for the number rating. For example, if the min is 2, the max is 10, and the step is 2, the options will be 2, 4, 6, 8, and 10.

Results:

  • Always visible: Default poll results. Users can always see the results of the poll, regardless of if they’ve voted.
  • On vote: Users must vote before they can see the results of the poll.
  • When closed: Poll results will only be revealed once the poll is closed.
  • Staff only: Only site staff will be able to see the poll results.

Allowed groups:
Allows the poll creator to limit which groups can participate in the poll. Users not in the listed groups will be able to view the poll, but not vote. Default is all users can participate, no group limitation.

Chart type:
For Single or Multiple Choice polls, choose whether to display the result in a bar graph or pie chart.

Show who voted:
When enabled, allows those who can view poll results to also view the specific choices of each poll user.

Automatically close poll:
Allows the poll creator to set a date/time for the poll to close automatically. Unlike manually closed polls, auto-closed polls cannot be re-opened.

Poll FAQs

Can anyone vote in a poll?
Users must be able to reply to the topic where the poll is created in order to participate. Users with see only permissions will not be able to vote.

Can I include images in a poll?
Yes! After using the poll builder to insert the poll, images can be uploaded to the post and added to the poll. Uploaded images should be small, or adjusted via Discourse to display at a lower percentage.

For example:

[poll type=regular]
* Cat: a small domesticated carnivorous mammal with soft fur, a short snout, and retractile claws.
![image|690x458,25%](upload://2u570X7kQiPJQaJD1Bd8MLDHDNB.jpeg)
* Dog: a domesticated carnivorous mammal that typically has a long snout, an acute sense of smell, and a barking, howling, or whining voice.
![image|690x334,25%](upload://35fmeFw8RMywSxIc4lbCb8UHPaT.jpg)
* Fish: a limbless cold-blooded vertebrate animal with gills and fins and living wholly in water.
![image|690x499,25%](upload://xSDkRwmuj1pNc2QXKzthfXRlwsX.jpg)
[/poll]

Can I include relative dates in a poll?
Yes! After using the poll builder to insert the poll, you can insert dates via the “Insert date / time” composer button.

Can polls be edited?
All votes are cleared when a poll is edited, to ensure the poll creator can’t change the choices a user voted for. As such, by default polls can only be edited for 5 minutes after being created.


Manually creating a poll

We strongly recommend using the poll builder to create polls - this will ensure the correct syntax is used. Details on manually creating a poll is below.

Manual Poll Creation

To create a poll surround a markdown list with [poll] and [/poll]

[poll]
- option one
- option two
- option three
[/poll]

or

[poll]
* option one
* option two
* option three
[/poll]

or, for numbered options—

[poll]
1. option one
2. option two
3. option three
[/poll]

Any of the above create the following result:

[poll name="poll_1"]
  1. option one
  2. option two
  3. option three
[/ [poll ]

You can also make a poll with multiple choices. Simply add type=multiple to the opening tag like so:

[poll type=multiple]
- option one
- option two
- option three
[/poll]

This creates the following result:

[poll name="poll_2" type=multiple]
  • option one
  • option two
  • option three
[/ [poll ]

To limit the number of choices (or set a minimum), add min=X and/or max=Y

[poll type=multiple min=2 max=3]
- option one
- option two
- option three
[/poll]

This creates the following result:

[poll name="poll_3" type=multiple min=2 max=3]
  • option one
  • option two
  • option three
  • option four
[/ [poll ]

Polls can even include images! When including images in polls you may wish to adjust the image size to avoid overly large images.

[poll type=regular]
* ![image|690x458,25%](upload://2u570X7kQiPJQaJD1Bd8MLDHDNB.jpeg)
* ![image|690x334,25%](upload://35fmeFw8RMywSxIc4lbCb8UHPaT.jpg)
* ![image|690x499,25%](upload://xSDkRwmuj1pNc2QXKzthfXRlwsX.jpg)
[/poll]
[poll name="poll_images_2" type=regular]
  • image
  • image
  • image
[/ [poll ]
[poll type=regular]
* Cat: a small domesticated carnivorous mammal with soft fur, a short snout, and retractile claws.
![image|690x458,25%](upload://2u570X7kQiPJQaJD1Bd8MLDHDNB.jpeg)
* Dog: a domesticated carnivorous mammal that typically has a long snout, an acute sense of smell, and a barking, howling, or whining voice.
![image|690x334,25%](upload://35fmeFw8RMywSxIc4lbCb8UHPaT.jpg)
* Fish: a limbless cold-blooded vertebrate animal with gills and fins and living wholly in water.
![image|690x499,25%](upload://xSDkRwmuj1pNc2QXKzthfXRlwsX.jpg)
[/poll]
[poll name="poll_images_text_2" type=regular]
  • Cat: a small domesticated carnivorous mammal with soft fur, a short snout, and retractile claws.
    image
  • Dog: a domesticated carnivorous mammal that typically has a long snout, an acute sense of smell, and a barking, howling, or whining voice.
    image
  • Fish: a limbless cold-blooded vertebrate animal with gills and fins and living wholly in water.
    image
[/ [poll ]

Polls can include relative dates!

[poll type=regular]
* [date=2019-10-13 timezone="Europe/Paris"]
* [date=2019-10-12 timezone="Europe/Paris"]
* [date=2019-10-11 timezone="Europe/Paris"]
[/poll]
[poll name="poll_relative_dates" type=regular results=always]
  • 2019-10-12T22:00:00Z
  • 2019-10-11T22:00:00Z
  • 2019-10-10T22:00:00Z
[/ [poll ]

For a numbered poll, enter the following:

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

Which produces:

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10

0 voters

You can also have it increment the numbers in steps using step=X

[poll type=number min=2 max=10 step=2]
[/poll]

Which produces:

  • 2
  • 4
  • 6
  • 8
  • 10

0 voters


If multiple polls are used in a single post (like this one!) be sure to give each poll a unique name, or they will not work. Do this by adding name="poll_name" as a parameter.

[poll name="poll_1"]
1. option one
2. option two
3. option three
[/poll]

[poll name="poll_3" type=multiple min=2 max=3]
- option one
- option two
- option three
- option four
[/poll]

[poll name="poll_5" type=number min=2 max=10 step=2]
[/poll]

Lastly, any poll can have the voters made “public” by adding public=true to the parameter list.

[poll public=true]
- Yes
- No
- Maybe
[/poll]

Do you like polls?

[poll name="public_poll" public=true]
  • Yes
  • No
  • Maybe
[/ [poll ]
4 Likes

It is also possible to add photos into a poll (like @Mongobongo is doing with Picture of the Month)

This is sample format:

[poll type=regular]
* ![image|690x458,25%](upload://2u570X7kQiPJQaJD1Bd8MLDHDNB.jpeg)
* ![image|690x334,25%](upload://35fmeFw8RMywSxIc4lbCb8UHPaT.jpg)
* ![image|690x499,25%](upload://xSDkRwmuj1pNc2QXKzthfXRlwsX.jpg)
[/poll]

If you want to find out proper ![image](upload:// ...) code to put into the poll just open the composer by hitting new reply. Then quote the post (or at least the photo). It will show you the code in the quoted text and then you can copy it and insert it properly into the poll…

That 25% part in the code makes it small thumbnail.

4 Likes

:joy: :v: Couldn’t release this until the Shark Tank was decomissioned, could you!?! :wink: :laughing:

:clipboard: :memo: :speaking_head:

:evergreen_tree:

4 Likes