Template:Sortkey: Difference between revisions
Jump to navigation
Jump to search
okay if something needs newline there will have to be another solution |
No edit summary |
||
| Line 2: | Line 2: | ||
{{#iferror:{{#time:Y-m-d|{{{date}}}}}|{{{date}}}}} | {{#iferror:{{#time:Y-m-d|{{{date}}}}}|{{{date}}}}} | ||
}}{{#if:{{{number|}}}| | }}{{#if:{{{number|}}}| | ||
{{formatnum:{{{number}}}}} | {{formatnum:{{{number}}}|R}} | ||
}}"{{!}}{{#if:{{{1|}}}|{{{1}}}|{{{date|}}}{{{number|}}}}}</includeonly><noinclude>{{documentation}}</noinclude> | }}"{{!}}{{#if:{{{1|}}}|{{{1}}}|{{{date|}}}{{{number|}}}}}</includeonly><noinclude>{{documentation}}</noinclude> | ||
Latest revision as of 14:40, 21 December 2025
Documentation [edit]
This template is used to tell the software how to sort certain kinds of data in a sortable table when they would otherwise not be sorted intuitively.
Parameters
The following are types of formatting that can be used separately, each using a named parameter as shown. More types can be added as needed.
- date - formats a date; must be in an unambiguous format, such as "January 1, 2000" or "1 Jan 2000".
- number - formats a number.
- first unnamed parameter (optional) - use this to display different text in the cell. Otherwise, the given parameter will be used as is.
Constraints
Currently, the following apply, but if needed they can be accounted for with additional parameters.
- No other properties can be applied to the cell.
- Does not work with lists.
- Other content cannot be placed before the display text.
- It DOES work with additional content placed after the template.
The above documentation is transcluded from Template:Sortkey/doc.