Template:Medals table/doc

From English Wikipedia @ Freddythechick

A template for generating a medals table for a sporting event where the totals and ranks are automatically calculated.

Template basics

<syntaxhighlight lang="wikitext" style="overflow: auto;">

RankNationGoldSilverBronzeTotal
Totals (0 entries)0000
Source: ...

</syntaxhighlight> Lua error: bad argument #1 to 'formatNum' (number expected, got string).

Parameters

Some of the optional parameters

Parameter Explanation
caption The caption or title given to the table
host The host entity. If set to a 3 letter code matching one of the rows, the host name will be automatically formatted. Otherwise this param will override the host text.
flag_template Which of the many flag templates to use. If left blank, {{flag country}} will be used.
event For flag templates which require a 2nd parameter (such as {{flag IOC team}}) this param will be that 2nd param.
team An optional override for the header to column 2. The default is "Nation".
hide_rank When set the rank column will be hidden.
hide_totals When set the totals row will be hidden.

For a list of valid IOC values, see List of IOC country codes

In case of multiple hosts, use |host1= and |host2=

Blank with all IOC codes

The below template contains a condensed version of the template with ALL IOC country codes included. Obviously not all are needed. You are free to pick and choose those that you need for your implementation of the template.

Template

<syntaxhighlight lang="wikitext" style="overflow: auto;">

RankNationGoldSilverBronzeTotal
Totals (0 entries)0000

</syntaxhighlight>

Event & Flag Template

If {{{event}}} and {{{flag_template}}} are given values, then the nation value will be rendered as {{<flag_template>|<IOC>|<event>}}.

So for example, with the following params: <syntaxhighlight lang="wikitext" style="overflow: auto;">

RankNationGoldSilverBronzeTotal
Totals (0 entries)0000

</syntaxhighlight>

The nations will be rendered as  United States (USA) &  Canada (CAN)

Example

<syntaxhighlight lang="wikitext" style="overflow: auto;">

RankNationGoldSilverBronzeTotal
1 France (FRA)74415
2 Great Britain (GBR)55515
3 United States (USA)53210
4 Australia (AUS)35715
5 South Africa (RSA)34310
6 Germany (GER)1337
Totals (6 entries)24242472
Source: [1]

</syntaxhighlight>

RankNationGoldSilverBronzeTotal
1 France (FRA)74415
2 Great Britain (GBR)55515
3 United States (USA)53210
4 Australia (AUS)35715
5 South Africa (RSA)34310
6 Germany (GER)1337
Totals (6 entries)24242472
Source: [2]

Example2

<syntaxhighlight lang="wikitext" style="overflow: auto;">  *   Host nation (Slovakia)

2015 Winter Universiade medal table
RankNationGoldSilverBronzeTotal
1 Russia99927
2 South Korea55515
3 Italy44412
Independent Athletes[4]1102
4 Slovakia*0011
Totals (4 entries)19191957
Source: [3]

</syntaxhighlight>   *   Host nation (Slovakia)

2015 Winter Universiade medal table
RankNationGoldSilverBronzeTotal
1 Russia99927
2 South Korea55515
3 Italy44412
Independent Athletes[6]1102
4 Slovakia*0011
Totals (4 entries)19191957
Source: [5]

References

  1. ^ Medal Tally
  2. ^ Medal Tally
  3. ^ Medal Tally
  4. ^ this is a note
  5. ^ Medal Tally
  6. ^ this is a note