Difference between revisions of "Template:AutoDEFAULTSORT"

From Disobiki
Jump to navigation Jump to search
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
<includeonly>{{#ifeq: {{#rmatch:{{PAGENAME}}|^(A{{!}}The)\s|1}} | 1 |
 
<includeonly>{{#ifeq: {{#rmatch:{{PAGENAME}}|^(A{{!}}The)\s|1}} | 1 |
   {{DEFAULTSORT:{{#if: {{{namespace|}}} | {{NAMESPACE}}: }}{{#rreplace:{{PAGENAME}}|^(A{{!}}The)\s|}}}}
+
   {{DEFAULTSORT:{{#rreplace:{{PAGENAME}}|^(A{{!}}The) |}}}}
  1:(({{#rreplace:{{PAGENAME}}|The|}}))
 
  2:{{PAGENAME}}
 
  3:{{#rreplace:ABC|B|D}}
 
 
| }}</includeonly><noinclude>
 
| }}</includeonly><noinclude>
 
==Usage==
 
==Usage==
  
Given "The Sinful Dwarf", return <code><nowiki>{{DEFAULTSORT:Sinful Dwarf}}</nowiki></code>. Handles "A Fistful of Dollars" too.<br />If <code>namespace=1</code> is passed, include the namespace (necessary for proper sorting of File: uploads, for example).
+
Given "The Sinful Dwarf", return <code><nowiki>{{DEFAULTSORT:Sinful Dwarf}}</nowiki></code>. Handles "A Fistful of Dollars" too.
  
 
<pre>
 
<pre>
 
  {{AutoDEFAULTSORT}}
 
  {{AutoDEFAULTSORT}}
{{AutoDEFAULTSORT|namespace=1}}
 
 
</pre>
 
</pre>
  
 
[[Category:Templates]]</noinclude>
 
[[Category:Templates]]</noinclude>

Latest revision as of 11:57, 25 June 2014

Usage

Given "The Sinful Dwarf", return {{DEFAULTSORT:Sinful Dwarf}}. Handles "A Fistful of Dollars" too.

 {{AutoDEFAULTSORT}}