Template:Votes: Difference between revisions

From Zelda Dungeon Wiki
Jump to navigation Jump to search
Want an adless experience? Log in or Create an account.
(Merged content to simplify use and documentation.)
mNo edit summary
Line 1: Line 1:
{{#switch:{{lc:{{{1|}}}}}
<includeonly>{{#vardefine:Votes|{{{1|}}}}}{{#vardefine:i|0}}{{#vardefine:VotesNum|0}}{{#while:|{{#ifexpr:{{#var:i}}<11|true}}|{{#vardefine:i|{{#expr:{{#var:i}}+1}}}}{{#vardefine:VotesNum|{{#expr:{{#var:VotesNum}}+{{#if:{{#explode:{{#var:Votes}}|*|{{#var:i}}}}|1|0}}}}}}}}{{#var:VotesNum}}</includeonly><noinclude>
|count={{#vardefine:Votes|{{{2|}}}}}{{#vardefine:i|0}}{{#vardefine:VotesNum|0}}{{#while:|{{#ifexpr:{{#var:i}}<11|true}}|{{#vardefine:i|{{#expr:{{#var:i}}+1}}}}{{#vardefine:VotesNum|{{#expr:{{#var:VotesNum}}+{{#if:{{#explode:{{#var:Votes}}|*|{{#var:i}}}}|1|0}}}}}}}}{{#var:VotesNum}}
|support={{{2|}}}{{#vardefine:SupportVotes|{{Votes|Count|{{{2|}}}}}}}
|oppose={{{2|}}}{{#vardefine:OpposeVotes|{{Votes|Count|{{{2|}}}}}}}
|total={{NumberColor|{{#expr:{{#var:SupportVotes}}-{{#var:OpposeVotes}}}}}}
}}<noinclude>
==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.
Line 13: Line 8:
<pre>
<pre>
===Support===
===Support===
{{Votes|Support|
{{Votes/Support|
<!-- Place support votes within the brackets and below this line.-->
<!-- Place support votes within the brackets and below this line.-->


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


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

Revision as of 02:14, March 28, 2013

Purpose

This template is used to automatically count the rolling votes in featured content nominations.

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:

===Support===
{{Votes/Support|
<!-- 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}}