Template:Sort Value

From Zelda Wiki, the Zelda encyclopedia
Jump to navigation Jump to search

Purpose

Displays terms in sortable tables such that the table data can be sorted according to an in-game order that was pre-defined using Template:Term List.

Usage

SyntaxBoilerplate
{{Sort Value|<game>|<subject>|sequence= }}
{{Sort Value||}}
ParameterStatusDescriptionAccepted values
1gamerequiredA game code.See Data:Franchise
2subjectrequiredA wiki page name to be sorted according to an in-game sequence.
sequenceoptionalIf the given subject belongs to more than one sequence in the given game, use this parameter to specify which sequence to use for sorting. See Module:Sequences/Supported Sequences.

Displays [[Template:Term|terms]] in [[Help:Tables#Sortable_Tables|sortable tables]] such that the table data can be sorted according to an in-game order that was pre-defined using [[Template:Term List]].

Template parameters

ParameterDescriptionTypeStatus
game1

A game code.

Stringrequired
subject2

A wiki page name to be sorted according to an in-game sequence.

Stringrequired
sequencesequence

If the given subject belongs to more than one sequence in the given game, use this parameter to specify which sequence to use for sorting. See [[Module:Sequences/Supported Sequences]].

Stringoptional

Examples

Suppose you were to make a sortable table mapping Spirit Tracks characters to the Realm they inhabit. Given that Realms are visited sequentially, it is more logical for the "Realm" column to sort according to their in-game order, rather than alphabetical order. That is, the order should be Forest Realm, Snow Realm, Ocean Realm, Fire Realm.

#InputOutput
1
{|class="wikitable sortable"
! Character
! Realm
|-
| {{Term|ST|Kofu|link}}
| {{Sort Value|ST|Snow Realm}}
|-
| {{Term|ST|Tengoron|link}}
| {{Sort Value|ST|Fire Realm}}
|-
| {{Term|ST|Wadatsumi|link}}
| {{Sort Value|ST|Ocean Realm}}
|-
| {{Term|ST|Wood (Character)|link}}
| {{Sort Value|ST|Forest Realm}}
|}
Character Realm
Kofu Snow Realm
Tengoron Fire Realm
Wadatsumi Ocean Realm
Wood Forest Realm

If a subject belongs to multiple sequences, the sequence parameter should be used to specify which sequence to sort by. The template will default to whichever sequence comes first alphabetically.

#InputOutputCategories added
The Noble Sword in Oracle of Seasons belongs to the Sword and Trading Quest sequences.
2{{Sort Value|OoS|Noble Sword}} data-sort-value="2"|Noble Sword
3{{Sort Value|OoS|Noble Sword|sequence= Swords}} data-sort-value="2"|Noble Sword
4{{Sort Value|OoS|Noble Sword|sequence= Trading Quest}} data-sort-value="13"|Noble Sword

If the specified sequence does not exist or the specified subject does not exist in the sequence, the subject is returned as-is without the sort value. Table rows will simply sort alphabetically.

#InputOutputCategories added
5{{Sort Value|OoS|Noble Sword|sequence= Not a Sequence}} Noble Sword
6{{Sort Value|ST|Not a Realm|sequence= Realms}} Not a Realm
7{{Sort Value|ST|Not a Realm}} Not a Realm
The above documentation is transcluded from Template:Sort Value/Documentation. (edit | history)