{poll_sum}

Description

Outputs the total number of votes cast in a poll - the sum of votes across every answer of the current poll. It takes no parameters and reads the poll from the item being rendered, so it only works inside the Polls module, in a poll design template where the current item is a poll answer (the answer carries the poll_id). The Polls module exposes the same value through the answer alias _#ANS_SUM_, whose definition is simply the poll_sum expression. Typical use is the result line under a finished poll, for example "Total votes: 1240". The value is the live SUM of the votes column in the polls_answer table for that poll, so it is runtime-dependent (it changes as people vote) and is never cached. Outside a poll design - on an ordinary page or in this reference - there is no current poll answer and the Polls expansion classes are not loaded, so the token is left unexpanded; all examples below are therefore marked illustrative.

Examples

virtualTotal votes: {poll_sum}
ExpectedTotal votes: 1240
ActualTotal votes: {poll_sum}
The core use: print the total number of votes for the current poll. Works only when the current item is a poll answer inside a Polls-module design template; the number shown here is illustrative.
virtual_#ANS_SUM_
Expected1240
Inside a poll design the answer alias _#ANS_SUM_ is defined as the poll_sum expression, so the two are interchangeable. Use whichever reads better in your template. The value is illustrative.
virtualThis answer: {poll_share} percent of {poll_sum} votes
ExpectedThis answer: 38 percent of 1240 votes
ActualThis answer: {poll_share} percent of {poll_sum} votes
poll_sum gives the whole-poll total; poll_share gives the current answers share of it (0-100 by default). They are often shown together on one answer row. Values are illustrative.
virtualA total of {poll_sum} readers voted. Voting is now closed.
ExpectedA total of 1240 readers voted. Voting is now closed.
ActualA total of {poll_sum} readers voted. Voting is now closed.
The canonical real-world pattern, taken from a live poll design: a summary line in the bottom area of the result template. In the original Czech install this reads "Celkem hlasovalo N ctenaru". Value illustrative.
virtual{poll_sum}
Expected{poll_sum}
Actual{poll_sum}
There are no parameters. On an ordinary page - no current poll answer, and the Polls expansion classes not loaded - the engine cannot resolve it and leaves the literal token in place (it does not error). This is why every example here is illustrative rather than a live test.