Template:Votes: Difference between revisions

Want an adless experience? Log in or Create an account.
should fix inputs with operators causing errors
(Undid revision 67446 by Locke (talk) nope, that makes it miscount empty inputs)
(should fix inputs with operators causing errors)
 
(5 intermediate revisions by the same user not shown)
Line 1: Line 1:
<includeonly>{{#vardefine:VotesNum|0}}{{#while:|{{#explode:{{N}}
<onlyinclude><includeonly>{{#vardefine:VotesNum|0}}{{#while:|{{NotEmpty|{{#explode:{{N}}
{{{1|}}}|{{N}}
{{{1|}}}|{{N}}
*|{{++|VotesNum}}}}|}}{{--|VotesNum}}</includeonly><noinclude>
#|{{++|VotesNum}}}}}}|}}{{--|VotesNum}}</includeonly></onlyinclude>
==Purpose==
==Purpose==
This template is used to automatically count the rolling votes in featured content nominations.
This template is used to automatically count the rolling votes in featured content nominations.


==Usage==
==Usage==
Using this template properly requires the following formatting to be put in place when setting up a new nomination, after which, it'll function on its own so long as new votes are put in the proper locations. This formatting goes within a nomination, below the introductory post:
Using this template properly requires a certain formatting to be put in place when setting up a new nomination, after which, it'll function on its own so long as new votes are put in the proper locations. This formatting is added to a nomination below the introductory post with the code:


<pre>
<pre>{{subst:Votes/Template}}</pre>
===Support===
 
{{Votes/Support|
This code can also be found in the edittools box when editing a nomination page.
<!-- Place support votes within the brackets and below this line.-->


}}
===Oppose===
{{Votes/Oppose|
<!-- Place opposition votes within the brackets and below this line.-->


}}
===Total===
{{Votes/Total|~}}
</pre>
{{Cat|Formatting Templates}}
{{Cat|Formatting Templates}}
</noinclude>