Template:Sort/doc: Difference between revisions

From Tardis Wiki, the free Doctor Who reference
(based on text from wikipedia:template:sort/doc)
 
No edit summary
Line 10: Line 10:
</pre>
</pre>


It presently works through hidden CSS, as described at [[Help:Sorting]]. If a cleaner way of doing this is developed, the template will be changed. A table using this template should use it in all rows.
It presently works through hidden CSS, as described at [[Wikipedia:Help:Sorting]]. If a cleaner way of doing this is developed, the template will be changed. A table using this template should use it in all rows.


'''Note:''' You should always have the same number of columns for a given table. E.g., if the wikitable will be sorting the numbers 56 (foo), 94 (bar), and 103 (baz), then your templates within that wikitable should be  
'''Note:''' You should always have the same number of columns for a given table. E.g., if the wikitable will be sorting the numbers 56 (foo), 94 (bar), and 103 (baz), then your templates within that wikitable should be  

Revision as of 20:20, 12 June 2012

{{sort}}, as the name implies, allows for the sorting of items — particularly in tables.

Usage
{{sort|sort value|displayed value}}

The first parameter is the sortkey; the second parameter is the wikitext of what has to be displayed. By default, this is the sortkey with link brackets.

Example
|{{sort|Brothers Karamazov|[[The Brothers Karamazov]]}}

It presently works through hidden CSS, as described at Wikipedia:Help:Sorting. If a cleaner way of doing this is developed, the template will be changed. A table using this template should use it in all rows.

Note: You should always have the same number of columns for a given table. E.g., if the wikitable will be sorting the numbers 56 (foo), 94 (bar), and 103 (baz), then your templates within that wikitable should be

{{sort|056|foo}}
{{sort|094|bar}}
{{sort|103|baz}}