Template:SortKeyName
Usage
[edit]This template creates a non-displaying set of <span>...</span> tags containing text, typically a person's name, to be sorted. When used at the beginning of each cell in a column of table cells, it provides a way to sort cells in a desired order. The non-displaying text is followed by the first two parameters in order, wikilinked.
To see this template in action, sort the "Life and death" column in the table at Stolpersteine in the Banská Bystrica Region, then examine the wikitext used there.
Parameters
[edit]When using the template with names, the parameters are used as follows:
- 1 (first unnamed parameter; required)
- Given name (first name) of the person to be sorted (the secondary sort key). Without this parameter, the template will produce no output.
- 2 (second unnamed parameter)
- Family name (last name) of the person to be sorted (the primary sort key)
- 3 (third unnamed parameter)
- Title of article to link to (optional). Use when the article title is different from the person's name, or needs to be disambiguated.
- nl
- Abbreviation for "no link". Set to any value to suppress wikilinking of the output text. Less useful when
|3=is used (see example below).
The template therefore allows for sorting a table column on the hidden text Parameter 2, Parameter 1, while showing linked text to Parameter 1 Parameter2 (or Parameter 3, if used).
Example output
[edit]The example output here is shown as wikitext in order to show the hidden text and the wikilinks that are generated.
{{SortKeyName|Ján|Bakoss}} → <span style="display:none;">Bakoss, Ján</span>[[Ján Bakoss]]
{{SortKeyName|John|Smith|John Smith (astronomer)}} → <span style="display:none;">Smith, John</span>[[John Smith (astronomer)|John Smith]]
{{SortKeyName|Ján|Bakoss|nl=1}} → <span style="display:none;">Bakoss, Ján</span>Ján Bakoss
{{SortKeyName|John|Smith|John Smith (astronomer)|nl=1}} → <span style="display:none;">Smith, John</span>John Smith (astronomer)|John Smith
TemplateData
[edit]TemplateData for SortKeyName
This template is used to create a non-displayed string for table sorting (in order Param2, Param1), combined with a displayed wikilinked string (of form [[Param1 Param2]], or alternately of form [[Param3]]).
| Parameter | Description | Type | Status | |
|---|---|---|---|---|
| given_name | 1 | Usually a first name, or other secondary sorting key | String | required |
| family_name | 2 | Usually a surname, or other primary sorting key | String | suggested |
| article_link | 3 | Alternative article for wikilink, when not in the form [[given_name family_name]] | String | optional |
| no_link | nl | When nl = 1 (or any value), no wikilink will be generated for the displayed text (usually 'given_name family_name'). | Number | optional |