<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.darkan.org/index.php?action=history&amp;feed=atom&amp;title=Template%3ASort%2Fdoc</id>
	<title>Template:Sort/doc - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.darkan.org/index.php?action=history&amp;feed=atom&amp;title=Template%3ASort%2Fdoc"/>
	<link rel="alternate" type="text/html" href="https://wiki.darkan.org/index.php?title=Template:Sort/doc&amp;action=history"/>
	<updated>2026-07-17T20:59:06Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.46.0</generator>
	<entry>
		<id>https://wiki.darkan.org/index.php?title=Template:Sort/doc&amp;diff=149594&amp;oldid=prev</id>
		<title>imported&gt;Blaze fire12 at 08:55, 17 November 2012</title>
		<link rel="alternate" type="text/html" href="https://wiki.darkan.org/index.php?title=Template:Sort/doc&amp;diff=149594&amp;oldid=prev"/>
		<updated>2012-11-17T08:55:56Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{Documentation}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
&lt;br /&gt;
This template is for optionally sorting tables by specified sortkeys.&lt;br /&gt;
&lt;br /&gt;
==Usage==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{&amp;lt;/nowiki&amp;gt;sort|&amp;#039;&amp;#039;sort value&amp;#039;&amp;#039;|&amp;#039;&amp;#039;displayed value (optional)&amp;#039;&amp;#039;}}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If necessary, one can apply sorting using a sortkey that, due to CSS, is not displayed: &amp;lt;nowiki&amp;gt;&amp;lt;span style=&amp;quot;display:none&amp;quot;&amp;gt;...&amp;lt;/span&amp;gt;&amp;lt;/nowiki&amp;gt;. Javascript sorting is based on the text inside and outside the tags, without the tags themselves. A hidden sortkey can be put at the start.&lt;br /&gt;
&lt;br /&gt;
This template makes that more convenient. The first parameter is the sortkey; the optional second parameter is the wikitext of what is to be displayed. By default, the wikitext is the sortkey.&lt;br /&gt;
&lt;br /&gt;
==Numerical sorting problems==&lt;br /&gt;
&lt;br /&gt;
Text breaks numerical sorting whether the text is before or after the number.&lt;br /&gt;
&lt;br /&gt;
A dash, of any kind, in a blank cell breaks numerical sorting of a column. A dash is only allowed in front of a number. A dash after a number breaks numerical sorting of a column. Therefore a range (30-40) breaks numerical sorting of a column.&lt;br /&gt;
&lt;br /&gt;
A plus sign (+) in front of a number does &amp;#039;&amp;#039;not&amp;#039;&amp;#039; break numerical sorting of a column. A plus sign in an otherwise empty cell can break numerical sorting of a column if the first non-empty cell going down a column consists of just a plus sign. A plus sign after a number can break numerical sorting if the first non-empty cell going down a column consists of a number followed by a plus sign.&lt;br /&gt;
&lt;br /&gt;
References after numbers currently break numerical sorting of a column.&lt;br /&gt;
&lt;br /&gt;
Leading zeroes are not necessary for numerical sorting of a column. If it seems that way, then that means the column is being sorted alphabetically.&lt;br /&gt;
&lt;br /&gt;
==Example usage==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
|{{sort|Brothers Karamazov|[[The Brothers Karamazov]]}}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It presently works through hidden CSS, as described above. A table using this template should use it in all rows.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Notes:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
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:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{{sort|056|foo}}&lt;br /&gt;
{{sort|094|bar}}&lt;br /&gt;
{{sort|103|baz}}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you simply code as the second parameter an indicator that two items are equally ranked, e.g., &amp;quot;4=&amp;quot;, the template interpreter treats this as an additional parameter (i.e., parameter 4, which it then does not use). You must explicitly code this as parameter 2:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{{sort|4|2=4=}}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;includeonly&amp;gt;[[Category:Formatting templates|{{PAGENAME}}]]&amp;lt;/includeonly&amp;gt;&lt;/div&gt;</summary>
		<author><name>imported&gt;Blaze fire12</name></author>
	</entry>
</feed>