Template:Sortable medal image documentation

This template is for including medal symbols in sporting event result tables, while preserving the ability for sort.

Template series
The first group of templates show medal images while giving a table sort of 01, 02 or 03, respectively.

The second group of templates are show medal images with display text of either Gold, Silver, Bronze. These also give a table sort of 01, 02 or 03, respectively.

Usage
Simply insert the template where you would like to see the symbol. No parameters are required.

Parameters
The link parameter can be used to pass a link to an article to these templates.

Example:

It defaults to null.

Sorting
These templates use 01, 02 and 03 as the gold, silver, and bronze sort value, respectively. Sorting will operate numerically unless the column also contains any non-numeric text, in which case a text sort may sometimes occur (e.g. "10" is before "3").

To get the desired sort results for other values it may be necessary to use the  and   attributes. Placing a  attribute in the header cell will force a numeric sort. Adding a  attribute to a data cell will override the value.

A commonly used but now-deprecated technique is to use the or  templates to specify appropriate sort keys to be inserted as hidden text in front of the displayed values. For example,  and   both display "DQ" but sort using "99 DQ". A text sort still occurs, but the desired results can be achieved using carefully selected hidden values. Sometimes leading zeros or other tricks may be needed.

See Help:Sorting for additional details.

Simple case
When all ranks are single digit numbers, the templates can be used directly in place of the ranks.

The following markup:



...will display as:

Handling two-digit rankings, blank, or special values
When the rankings contain two-digit rankings, blank, or special values, additional markup may be needed to trigger numeric sorting and/or to explicitly set equivalent sort values. The preferred method is to use the  and   attributes. Placing a  attribute in the header cell will force a numeric sort order. Adding a  attribute to a data cell will override the value.

The following markup:



...will display as:

As demonstrated in the rightmost column, the and  templates can also be used to resolve sorting problems, but this methodology is deprecated.

Deprecated templates
The below templates have had their functionality merged into the main templates, as bad sorting is never a useful feature.
 * Goca
 * Sica
 * Brca
 * Gold01
 * Silver02
 * Bronze03