Difference between revisions of "Template:MedalCount"

From blackwiki
Jump to navigation Jump to search
imported>Tibullus
m (Reverted edits by Tibullus (talk) to last version by WOSlinker)
imported>Yoki Yoki
Line 13: Line 13:
 
|-
 
|-
 
{{#if:{{{1|}}}|
 
{{#if:{{{1|}}}|
! scope="row" style="font-weight:normal; text-align:left" {{!}} {{#if:1|{{{1}}}}}
+
! scope="row" style="font-weight:normal; text-align:right" {{!}} {{#if:1|{{{1}}}}}
 
{{!}} style="background-color:#FEEC80;" {{!}} {{#if:1|{{{2|}}}}}
 
{{!}} style="background-color:#FEEC80;" {{!}} {{#if:1|{{{2|}}}}}
 
{{!}} style="background-color:#E5E5E5;" {{!}} {{#if:1|{{{3|}}}}}
 
{{!}} style="background-color:#E5E5E5;" {{!}} {{#if:1|{{{3|}}}}}
Line 20: Line 20:
 
|-
 
|-
 
{{#if:{{{5|}}}|
 
{{#if:{{{5|}}}|
! scope="row" style="font-weight:normal; text-align:left" {{!}} {{#if:1|{{{5}}}}}
+
! scope="row" style="font-weight:normal; text-align:right" {{!}} {{#if:1|{{{5}}}}}
 
{{!}} style="background-color:#FEEC80;" {{!}} {{#if:1|{{{6|}}}}}
 
{{!}} style="background-color:#FEEC80;" {{!}} {{#if:1|{{{6|}}}}}
 
{{!}} style="background-color:#E5E5E5;" {{!}} {{#if:1|{{{7|}}}}}
 
{{!}} style="background-color:#E5E5E5;" {{!}} {{#if:1|{{{7|}}}}}
Line 27: Line 27:
 
|-
 
|-
 
{{#if:{{{9|}}}|
 
{{#if:{{{9|}}}|
! scope="row" style="font-weight:normal; text-align:left" {{!}} {{#if:1|{{{9}}}}}
+
! scope="row" style="font-weight:normal; text-align:right" {{!}} {{#if:1|{{{9}}}}}
 
{{!}} style="background-color:#FEEC80;" {{!}} {{#if:1|{{{10|}}}}}
 
{{!}} style="background-color:#FEEC80;" {{!}} {{#if:1|{{{10|}}}}}
 
{{!}} style="background-color:#E5E5E5;" {{!}} {{#if:1|{{{11|}}}}}
 
{{!}} style="background-color:#E5E5E5;" {{!}} {{#if:1|{{{11|}}}}}
Line 34: Line 34:
 
|-
 
|-
 
{{#if:{{{13|}}}|
 
{{#if:{{{13|}}}|
! scope="row" style="font-weight:normal; text-align:left" {{!}} {{#if:1|{{{13}}}}}
+
! scope="row" style="font-weight:normal; text-align:right" {{!}} {{#if:1|{{{13}}}}}
 
{{!}} style="background-color:#FEEC80;" {{!}} {{#if:1|{{{14|}}}}}
 
{{!}} style="background-color:#FEEC80;" {{!}} {{#if:1|{{{14|}}}}}
 
{{!}} style="background-color:#E5E5E5;" {{!}} {{#if:1|{{{15|}}}}}
 
{{!}} style="background-color:#E5E5E5;" {{!}} {{#if:1|{{{15|}}}}}
Line 41: Line 41:
 
|-
 
|-
 
{{#if:{{{17|}}}|
 
{{#if:{{{17|}}}|
! scope="row" style="font-weight:normal; text-align:left" {{!}} {{#if:1|{{{17}}}}}
+
! scope="row" style="font-weight:normal; text-align:right" {{!}} {{#if:1|{{{17}}}}}
 
{{!}} style="background-color:#FEEC80;" {{!}} {{#if:1|{{{18|}}}}}
 
{{!}} style="background-color:#FEEC80;" {{!}} {{#if:1|{{{18|}}}}}
 
{{!}} style="background-color:#E5E5E5;" {{!}} {{#if:1|{{{19|}}}}}
 
{{!}} style="background-color:#E5E5E5;" {{!}} {{#if:1|{{{19|}}}}}
Line 48: Line 48:
 
|-
 
|-
 
{{#if:{{{21|}}}|
 
{{#if:{{{21|}}}|
! scope="row" style="font-weight:normal; text-align:left" {{!}} {{#if:1|{{{21}}}}}
+
! scope="row" style="font-weight:normal; text-align:right" {{!}} {{#if:1|{{{21}}}}}
 
{{!}} style="background-color:#FEEC80;" {{!}} {{#if:1|{{{22|}}}}}
 
{{!}} style="background-color:#FEEC80;" {{!}} {{#if:1|{{{22|}}}}}
 
{{!}} style="background-color:#E5E5E5;" {{!}} {{#if:1|{{{23|}}}}}
 
{{!}} style="background-color:#E5E5E5;" {{!}} {{#if:1|{{{23|}}}}}
Line 55: Line 55:
 
|-
 
|-
 
{{#if:{{{25|}}}|
 
{{#if:{{{25|}}}|
! scope="row" style="font-weight:normal; text-align:left" {{!}} {{#if:1|{{{25}}}}}
+
! scope="row" style="font-weight:normal; text-align:right" {{!}} {{#if:1|{{{25}}}}}
 
{{!}} style="background-color:#FEEC80;" {{!}} {{#if:1|{{{26|}}}}}
 
{{!}} style="background-color:#FEEC80;" {{!}} {{#if:1|{{{26|}}}}}
 
{{!}} style="background-color:#E5E5E5;" {{!}} {{#if:1|{{{27|}}}}}
 
{{!}} style="background-color:#E5E5E5;" {{!}} {{#if:1|{{{27|}}}}}
Line 62: Line 62:
 
|-
 
|-
 
{{#if:{{{29|}}}|
 
{{#if:{{{29|}}}|
! scope="row" style="font-weight:normal; text-align:left" {{!}} {{#if:1|{{{29}}}}}
+
! scope="row" style="font-weight:normal; text-align:right" {{!}} {{#if:1|{{{29}}}}}
 
{{!}} style="background-color:#FEEC80;" {{!}} {{#if:1|{{{30|}}}}}
 
{{!}} style="background-color:#FEEC80;" {{!}} {{#if:1|{{{30|}}}}}
 
{{!}} style="background-color:#E5E5E5;" {{!}} {{#if:1|{{{31|}}}}}
 
{{!}} style="background-color:#E5E5E5;" {{!}} {{#if:1|{{{31|}}}}}
Line 69: Line 69:
 
|-
 
|-
 
{{#if:{{{33|}}}|
 
{{#if:{{{33|}}}|
! scope="row" style="font-weight:normal; text-align:left" {{!}} {{#if:1|{{{33}}}}}
+
! scope="row" style="font-weight:normal; text-align:right" {{!}} {{#if:1|{{{33}}}}}
 
{{!}} style="background-color:#FEEC80;" {{!}} {{#if:1|{{{34|}}}}}
 
{{!}} style="background-color:#FEEC80;" {{!}} {{#if:1|{{{34|}}}}}
 
{{!}} style="background-color:#E5E5E5;" {{!}} {{#if:1|{{{35|}}}}}
 
{{!}} style="background-color:#E5E5E5;" {{!}} {{#if:1|{{{35|}}}}}
Line 76: Line 76:
 
|-
 
|-
 
{{#if:{{{37|}}}|
 
{{#if:{{{37|}}}|
! scope="row" style="font-weight:normal; text-align:left" {{!}} {{#if:1|{{{37}}}}}
+
! scope="row" style="font-weight:normal; text-align:right" {{!}} {{#if:1|{{{37}}}}}
 
{{!}} style="background-color:#FEEC80;" {{!}} {{#if:1|{{{38|}}}}}
 
{{!}} style="background-color:#FEEC80;" {{!}} {{#if:1|{{{38|}}}}}
 
{{!}} style="background-color:#E5E5E5;" {{!}} {{#if:1|{{{39|}}}}}
 
{{!}} style="background-color:#E5E5E5;" {{!}} {{#if:1|{{{39|}}}}}

Revision as of 18:39, 9 July 2015

Template documentation[view] [edit] [history] [purge]

Usage

Usage with table markup

Type
Event 1st 2nd 3rd
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
{| 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
Podiums
Event 1st 2nd 3rd
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
{{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

Name
Medal record
Sport
Representing Template:NRU
Podiums
Event 1st 2nd 3rd
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
{{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

Script error: No such module "If empty".
Sport
CountryCountry
SportSport
Medal record
Event 1st 2nd 3rd
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
Template:Wikidata image
{{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:

Script error: No such module "If empty".
Personal information
Born (1974-01-27) 27 January 1974 (age 51)
Drammen, Norway
Medal record
Men's biathlon
Representing Template:NOR
Event 1st 2nd 3rd
Olympic Games 8 4 1
World Championships 19 12 9
Summer World Championships 1 1 1
Norwegian Championships 30 8 12
Summer Norwegian Championships 14 5 0
Junior World Championships 3 0 1
Junior Norwegian Championships 4 1 1
Total (135 medals) 79 31 25
Template:Wikidata image
{{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
Event 1st 2nd 3rd
Olympic Games 8 4 1
World Championships 19 12 9
Summer World Championships 1 1 1
Norwegian Championships 30 8 12
Summer Norwegian Championships 14 5 0
Junior World Championships 3 0 1
Junior Norwegian Championships 4 1 1
{{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