Difference between revisions of "Template:MedalCount/sandbox"
Jump to navigation
Jump to search
Template:Wikidata image
Template:Wikidata image
imported>Zyxw (Add an optional automatically calculated total row at bottom. Can replace the manually calculated total row often found in articles using this template.) |
imported>Zyxw (update to handle non-numeric parameters) |
||
Line 83: | Line 83: | ||
{{#ifeq:{{yesno|{{{total|}}}}}|yes| | {{#ifeq:{{yesno|{{{total|}}}}}|yes| | ||
! scope="row" style="text-align:left;" {{!}} {{#if:{{{total_label|}}}|{{{total_label|}}}|Total}} | ! scope="row" style="text-align:left;" {{!}} {{#if:{{{total_label|}}}|{{{total_label|}}}|Total}} | ||
− | {{!}} style="background-color:#FEEC80; font-weight:bold; text-align:center;" {{!}} {{#expr:{{{2|0}}}+{{{6|0}}}+{{{10|0}}}+{{{14|0}}}+{{{18|0}}}+{{{22|0}}}+{{{26|0}}}+{{{30|0}}}+{{{34|0}}}+{{{38|0}}}}} | + | {{!}} style="background-color:#FEEC80; font-weight:bold; text-align:center;" {{!}} {{#expr:{{isnumeric|{{{2|0}}}}}+{{isnumeric|{{{6|0}}}}}+{{isnumeric|{{{10|0}}}}}+{{isnumeric|{{{14|0}}}}}+{{isnumeric|{{{18|0}}}}}+{{isnumeric|{{{22|0}}}}}+{{isnumeric|{{{26|0}}}}}+{{isnumeric|{{{30|0}}}}}+{{isnumeric|{{{34|0}}}}}+{{isnumeric|{{{38|0}}}}}}} |
− | {{!}} style="background-color:#E5E5E5; font-weight:bold; text-align:center;" {{!}} {{#expr:{{{3|0}}}+{{{7|0}}}+{{{11|0}}}+{{{15|0}}}+{{{19|0}}}+{{{23|0}}}+{{{27|0}}}+{{{31|0}}}+{{{35|0}}}+{{{39|0}}}}} | + | {{!}} style="background-color:#E5E5E5; font-weight:bold; text-align:center;" {{!}} {{#expr:{{isnumeric|{{{3|0}}}}}+{{isnumeric|{{{7|0}}}}}+{{isnumeric|{{{11|0}}}}}+{{isnumeric|{{{15|0}}}}}+{{isnumeric|{{{19|0}}}}}+{{isnumeric|{{{23|0}}}}}+{{isnumeric|{{{27|0}}}}}+{{isnumeric|{{{31|0}}}}}+{{isnumeric|{{{35|0}}}}}+{{isnumeric|{{{39|0}}}}}}} |
− | {{!}} style="background-color:#FFCC99; font-weight:bold; text-align:center;" {{!}} {{#expr:{{{4|0}}}+{{{8|0}}}+{{{12|0}}}+{{{16|0}}}+{{{20|0}}}+{{{24|0}}}+{{{28|0}}}+{{{32|0}}}+{{{36|0}}}+{{{40|0}}}}} | + | {{!}} style="background-color:#FFCC99; font-weight:bold; text-align:center;" {{!}} {{#expr:{{isnumeric|{{{4|0}}}}}+{{isnumeric|{{{8|0}}}}}+{{isnumeric|{{{12|0}}}}}+{{isnumeric|{{{16|0}}}}}+{{isnumeric|{{{20|0}}}}}+{{isnumeric|{{{24|0}}}}}+{{isnumeric|{{{28|0}}}}}+{{isnumeric|{{{32|0}}}}}+{{isnumeric|{{{36|0}}}}}+{{isnumeric|{{{40|0}}}}}}} |
}} | }} | ||
|}<noinclude> | |}<noinclude> |
Latest revision as of 20:48, 9 August 2017
|
![]() | This is the template sandbox page for Template:MedalCount (diff). See also the companion subpage for test cases. |
Contents
Usage
Usage with table markup
|
{| class="infobox" style="width:22em;" {{MedalCount |type=Type | Event1 | 0 | 0 | 0 | Event2 | 0 | 0 | 0 | Event3 | 0 | 0 | 0 | Event4 | 0 | 0 | 0 | Event5 | 0 | 0 | 0 | Event6 | 0 | 0 | 0 | Event7 | 0 | 0 | 0 | Event8 | 0 | 0 | 0 | Event9 | 0 | 0 | 0 | Event10| 0 | 0 | 0 }} |}
Usage with MedalBox
Medal record | ||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Sport | ||||||||||||||||||||||||||||||||||||||||||||||||||
Representing Country | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
{{MedalBox | sport = Sport | country = Country | medals = {{MedalCount |type=Podiums | Event1 | 0 | 0 | 0 | Event2 | 0 | 0 | 0 | Event3 | 0 | 0 | 0 | Event4 | 0 | 0 | 0 | Event5 | 0 | 0 | 0 | Event6 | 0 | 0 | 0 | Event7 | 0 | 0 | 0 | Event8 | 0 | 0 | 0 | Event9 | 0 | 0 | 0 | Event10| 0 | 0 | 0 }} }}
Usage with MedalTableTop
Medal record | ||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Sport | ||||||||||||||||||||||||||||||||||||||||||||||||||
Representing Template:NRU | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
{{MedalTableTop | name = Name | sport = Sport | country_code = NRU | medals = {{MedalCount |type=Podiums | Event1 | 0 | 0 | 0 | Event2 | 0 | 0 | 0 | Event3 | 0 | 0 | 0 | Event4 | 0 | 0 | 0 | Event5 | 0 | 0 | 0 | Event6 | 0 | 0 | 0 | Event7 | 0 | 0 | 0 | Event8 | 0 | 0 | 0 | Event9 | 0 | 0 | 0 | Event10| 0 | 0 | 0 }} }}
Usage with Infobox sportsperson
Sport | |||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Country | Country | ||||||||||||||||||||||||||||||||||||||||||||||||
Sport | Sport | ||||||||||||||||||||||||||||||||||||||||||||||||
Collapse
Medal record
|
{{Infobox sportsperson | name = Name | country = Country | sport = Sport | medaltemplates = {{MedalCount | Event1 | 0 | 0 | 0 | Event2 | 0 | 0 | 0 | Event3 | 0 | 0 | 0 | Event4 | 0 | 0 | 0 | Event5 | 0 | 0 | 0 | Event6 | 0 | 0 | 0 | Event7 | 0 | 0 | 0 | Event8 | 0 | 0 | 0 | Event9 | 0 | 0 | 0 | Event10| 0 | 0 | 0 }} }}
Example
Within an infobox
From Ole Einar Bjørndalen:
Personal information | |||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Born | Drammen, Norway | 27 January 1974||||||||||||||||||||||||||||||||||||||||||||||
Collapse
Medal record
|
{{Infobox biathlete | name = Ole Einar Bjørndalen | birth_date = {{birth date and age|df=yes|1974|1|27}} | birth_place = [[Drammen]], Norway | show-medals = yes | medaltemplates = {{Medal|Sport|Men's [[biathlon]]}} {{Medal|Country|{{NOR}}}} {{MedalCount | [[Winter Olympic Games|Olympic Games]] | 8 | 4 | 1 | [[Biathlon World Championships|World Championships]] | 19 | 12 | 9 | {{nowrap|[[Summer Biathlon World Championships|Summer World Championships]]}} | 1 | 1 | 1 | {{nowrap|[[Norwegian Biathlon Championships|Norwegian Championships]]}} | 30 | 8 | 12 | {{nowrap|Summer Norwegian Championships}} | 14 | 5 | 0 | {{nowrap|[[Biathlon Junior World Championships|Junior World Championships]]}} | 3 | 0 | 1 | {{nowrap|Junior Norwegian Championships}} | 4 | 1 | 1 | '''Total (135 medals)''' | '''79''' | '''31''' | '''25''' }} }}
Automatically calculated total row
Medal record | ||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Men's biathlon | ||||||||||||||||||||||||||||||||||||||
Representing Template:NOR | ||||||||||||||||||||||||||||||||||||||
|
{{MedalBox|medals= {{Medal|Sport|Men's [[biathlon]]}} {{Medal|Country|{{NOR}}}} {{MedalCount | total = yes | [[Winter Olympic Games|Olympic Games]] | 8 | 4 | 1 | [[Biathlon World Championships|World Championships]] | 19 | 12 | 9 | {{nowrap|[[Summer Biathlon World Championships|Summer World Championships]]}} | 1 | 1 | 1 | {{nowrap|[[Norwegian Biathlon Championships|Norwegian Championships]]}} | 30 | 8 | 12 | {{nowrap|Summer Norwegian Championships}} | 14 | 5 | 0 | {{nowrap|[[Biathlon Junior World Championships|Junior World Championships]]}} | 3 | 0 | 1 | {{nowrap|Junior Norwegian Championships}} | 4 | 1 | 1 }} }}
See also
- {{MedalBox}}
- {{MedalTableTop}}
- {{Medal}}
- {{Infobox sportsperson}}
- Category:Sportsperson infobox templates
The above documentation is transcluded from Template:MedalCount/doc. (edit | history) Editors can experiment in this template's sandbox (edit | diff) and testcases (edit) pages. Please add categories to the /doc subpage. Subpages of this template. |