Template:Sort

From PathfinderWiki

{{{1}}}

Template documentation (for the above template, sometimes hidden or invisible)
Subpages of this template:

{{Sort}} 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.

Usage

{{Sort|sort key}}

The template takes one unnamed parameter:

sort key
The text to use when sorting the table by this cell's column.

Example

{| class="tantable sortable"
! Title
! Issue
|-
| ''Dance of the Damned''
| {{Sort|099}} PF #99
|-
| {{Sort|Song of Silver, A}} ''A Song of Silver''
| {{Sort|100}} PF #100
|-
| {{Sort|Kintargo Contract, The}} ''The Kintargo Contract''
| {{Sort|101}} PF #101
|-
|}
results in
Title Issue
Dance of the Damned 099 PF #99
Song of Silver, A A Song of Silver 100 PF #100
Kintargo Contract, The The Kintargo Contract 101 PF #101

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, pad all numbers with enough leading zeroes for the sort key with the most digits ("09" comes before "10", "099" comes before "100", etc.).