Template:Sortname
[[ {{{1}}}]]
{{Sortname}} is a utility template used to force a cell in a sortable table (one using the sortable class) to be sorted differently from its contents.
Unlike {{Sort}}, {{Sortname}} is designed specifically for sorting names, and both sorts and displays output.
This template might not be appropriate for all types of names. In those cases, use {{Sort}}.
Usage
{{Sortname|family/last/single name|first/given name|second name|third name|fourth name}}
The template requires at least one unnamed parameter and accepts up to five:
- last/single name
- The person's family, last, or only name
- first name, second...
- The person's other names, in order from their first
The name is both displayed and linked. To override the displayed text with any arbitrary wikitext, provide it as the value of the link parameter:
For example:
{{Sortname|last|first|link=Somebody Someone}}
- results in
- Somebody Someone
with a sortkey of "last first".
Example
{| class="tantable sortable" ! Title ! Author |- | {{Sort|Song of Silver, A}} ''A Song of Silver'' | {{Sortname|Jacobs|James}} |- | Breachill, Outpost of Secrets | {{Sortname|Hamon|Amanda}} |- | [[Azlant]] in the [[Inner Sea region|Inner Sea]] | {{Sortname|Lee|Isabelle}} |- |}
- results in
Title Author A Song of Silver James Jacobs Breachill, Outpost of Secrets Amanda Hamon Azlant in the Inner Sea Isabelle Lee
When clicking on the table header row to sort by column contents, note how the sort keys affect the resulting order.
Numbers are not sorted in truly numeric order; "10" is sorted before "9", because "1" comes before "9" in sorting order in the same sense that "Aroden" comes before "Zyphus". To correctly sort numbers, use {{Sort}} instead.