TIP TopicVotePlugin is not installed on Foswiki.org.


Enables voting on topics


The plugin allows you to setup a voting system for topics. Imagine you have an idea, innovation or suggestion described in a topic and wants wiki users to vote for it, TopicVotePlugin let you setup and manage a voting system. You can even include multiple topics in your voting system or in this case in your poll.

There is a configuration topic for each voting system to define users and to set a number of credit points for them. All these users can now participate in that voting and share their credit points out on sevaral topics belonging to your poll.


Setup new voting system

To setup a new voting system simply add %TOPICVOTESETUP% to a topic. It will automatically inserts the necessary table for configuration:

Header Description
username name of wikiuser who participate
credit points number of remaining credit points to share out
latest vote datetime of users last vote
comment use it for any comment about that user

Each table row defines a wikiuser and a number of credit points. Add as many wikiusers as you want to join your voting.

Additionally another table will be generated which is used for logging all submitted votes. This log table will be inserted in a new topic called "[SETUPTOPIC]Log" to separate logging from configuation. The inserted table looks like:

Column: Description:
date date of that log entry
username name of wikiuser who has voted
topic name of topic which has been voted
credit points number of shared credit points on that topic

Note: Do not touch this table! It is updating automatically. Any editing manually will mix up the voting stats.

Include topic

To include a topic into a voting system simply add %TOPICVOTE{...}% to a topic.

Supported parameters:

Parameter: Description: Default:
topic="" The topic which contains the necessary voting system Current topic
maxpoints="" Defines the maximum of credit points a user can share out on that topic.
Set "0" for no limitation.
disable="" Set disable="1" to disable voting for the current topic 0
format="" Defines custom look-and-feel for the output by using the format variables: $score, $board, $form
e.g. format="<font color='red'>$score</font><br/>$board $form"
$board $form

The makro renders a form to submit credit points and vote for the current topic. It also adds additional information about the voting:

Row: Description:
topic score Total of all shared credit points on the current topic
credit points shared Total of all shared credit points on the current topic from logged in user
credit points left Remaining credit points for that voting of logged in user

You can include as many topics as you want to be part of one voting system.

Chart your score

You can define a DataForm to store the voting score in each participating topic. The Plugin will automatically update the score meta field after an user has vote for the topic. The DataForm should provide at least the fields described in the following example:

Name Type Size Values Tooltip message Attributes
Score label 2 0 (total score of a topic) H
Configurationtopic label 10 0 (name of the topic where the voting configuration is set up) H

The type "label" ensures that no user can modify it manually.

Just use the foswiki SEARCH macro for charting your votings by searching that DataForm:
%SEARCH{"form.name~'*YourDataForm'" type="query" format="| $topic | $formfield(Score) |" nonoise="on"}%

Note: Since it is necessary to edit the meta data of the voting topic, your participants need to have CHANGE rights. However if some of your participants have only VIEW rights for the voting topic, you can set up an separate user here, who handles the meta field manipulation: He needs to have CHANGE and VIEW rights. Otherwise you cannot use the meta field feature described above.


Voting system

Voting setup
username credit points latest vote comment
JohnConnor 9 - just an example wikiuser
ThomasAnderson 15 - -

Voting log
date username topic credit points
12. Jul 2009 - 10:33:07 JohnConnor MoreFreshFruits 7
07. Jul 2009 - 15:03:30 JohnConnor LessTerminatorSequels 4
03. Jul 2009 - 11:28:01 ThomasAnderson MoreITSupport 5

Voting Topic

Vote for it
topic score: 7
credit points shared: 11
credit points left: 9

Installation Instructions

Visit the Plugin Home for a manually installation:

  • Download the ZIP file from the Plugin Home
  • Unzip TopicVotePlugin.zip in your Foswiki installation directory. Content:
    File: Description:
    data/System/TopicVotePlugin.txt Plugin topic
    lib/Foswiki/Plugins/TopicVotePlugin.pm Plugin Perl module
  • Run the configure script, and enable the plugin in the {Plugins} section.
  • Add %TOPICVOTESETUP% to a topic to test if the installation was successful.


Many thanks to the following sponsors for supporting this work:

Reifenhaeuser GmbH   Co. KG Maschinenfabrik

Reifenhäuser GmbH & Co. KG Maschinenfabrik

Author(s): Foswiki:Main.SvenHess
Copyright: © 2009, Foswiki:Main.SvenHess
License: GPL (Gnu General Public License)
Version: 1.3
Change History:  
12 January 2010: Meta field manipulation is now handled by a seperate defined user
15 September 2009: Added format parameter for customizing output format
13 August 2009: Added credit points limitation and meta data for topic score
08 July 2009: Initial version
Dependencies: none
Home page: http://foswiki.org/bin/view/Extensions/TopicVotePlugin
Support: http://foswiki.org/bin/view/Support/TopicVotePlugin

Topic revision: r10 - 15 Feb 2010, SvenHess
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy