Difference between revisions of "Template:Sort"
Jump to navigation
Jump to search
)
MyraMidnight (talk | contribs) m |
MyraMidnight (talk | contribs) m |
||
(One intermediate revision by the same user not shown) | |||
Line 1: | Line 1: | ||
− | < | + | <onlyinclude>data-sort-value="{{{1}}}"</onlyinclude> |
{|{{Template Explanation}} [[Category:Templates]] | {|{{Template Explanation}} [[Category:Templates]] | ||
This template will add the "data-sort-value", which lets you control how it is sorted in a sortable table | This template will add the "data-sort-value", which lets you control how it is sorted in a sortable table | ||
:Very useful when you want to sort something by category/group rather than spelling | :Very useful when you want to sort something by category/group rather than spelling | ||
===How to use=== | ===How to use=== | ||
+ | :This works like any extra formatting in tables, remember to add a ''vertical bar'' <code>|</code> before the content of cell unless you are using it with [[template:Table Cell Templates|Table Cell Templates]]. | ||
*'''<code><nowiki>{{sort|1}}</nowiki></code>''' | *'''<code><nowiki>{{sort|1}}</nowiki></code>''' | ||
*:You replace '''1''' with what sort value you want, which will overwrite whatever is written in the table cell (basically dismisses it's spelling when sorting alphabetically). You can use numbers too | *:You replace '''1''' with what sort value you want, which will overwrite whatever is written in the table cell (basically dismisses it's spelling when sorting alphabetically). You can use numbers too | ||
|} | |} |
Latest revision as of 04:20, 1 July 2015
data-sort-value="{{{1}}}"
Template documentation ()
- The above documentation is transcluded from Template:Sort/doc.
- Editors can experiment in this template's sandbox
- Please add categories to the /doc subpage within
<includeonly>...</includeonly>
This template will add the "data-sort-value", which lets you control how it is sorted in a sortable table
- Very useful when you want to sort something by category/group rather than spelling
How to use[edit]
- This works like any extra formatting in tables, remember to add a vertical bar
|
before the content of cell unless you are using it with Table Cell Templates.
{{sort|1}}
- You replace 1 with what sort value you want, which will overwrite whatever is written in the table cell (basically dismisses it's spelling when sorting alphabetically). You can use numbers too