This is another small wikicode trick, that can be very useful in some situations, but also allows poll result manipulation. It's a trick to make polls editable.

Prerequisites for this guide are the knowledge of using and creating templates.

What are polls?

If you don't know polls at all, here is a short introduction:

Did you ever create an own poll?

The poll was created at 13:09 on April 16, 2016, and so far 21 people voted.

This is a poll. Everyone, including anonymous users, can vote in it. All votes are anonymous. The wikicode for it looks like this:

<poll>Did you ever create an own poll?
I'm not sure

The first line is the question, every other line is a new option. Make sure to use the source edit mode for it to prevent double newlines.

The Limitations

Polls have one small limitation: If you change the content (for example to fix a typo in the question or to add another option), this will be seen as a new poll and all votes will be reset to 0.

The Trick

I found one trick to circumvent this: Usage of templates! If the content of a poll is a template, then the template can be edited and the poll won't be reset.

Now, you usually don't want to create a new template for every poll. So here is another trick: Use transclusion to use the page where the poll is as a template itself! There are two ways to do that:

  • Encapsulate the template part of the page with both <includeonly> and <onlyinclude> tags. This will make sure the page itself does not include the template and the template does not include the rest of the page.
  • Alternatively, encapsulate the template part with the <includeonly> and all the rest of the page with the <noinclude> tags. This has exactly the same effect.

Now put all lines inside the poll in the template part and use the template between the poll tags. This is some example code for a page that uses this trick:

This page features an editable poll
<includeonly><onlyinclude>Is this poll editable?
Where "Namespace:NameOfThisPage" has to be replaced by the correct name. Leave the namespace empty (but don't remove the colon) if you are in the article (Main) namespace.

After editing the poll template, you might have to purge the page to see the results.

Going Further

The code shown above means the page can include only one editable poll, because every usage as template will have a different result. The following code will solve this problem too. I won't go into further detail on this one, except for a link to the used #switch parser function.

|poll1=Question 1?
First option of Q1
Second option of Q1
|poll2=Question 2?
First option of Q2
Second option of Q2
Third option of Q2
|poll3=Question 3?
You know what goes here...|}}


I recommend to avoid removing options from polls. While this is possible, the count for the removed option will still be remembered and if you add another option it will start with that count.

The Result

The following polls are all editable. Tell me in the comments if you want an option added.

What is your favorite fruit?

The poll was created at 14:03 on April 16, 2016, and so far 14 people voted.
What is the answer to live, the universe, and everything?

The poll was created at 14:03 on April 16, 2016, and so far 14 people voted.
Is this blog well written and understandable?

The poll was created at 14:03 on April 16, 2016, and so far 15 people voted.
Community content is available under CC-BY-SA unless otherwise noted.