Difference between revisions of "Template:AutoDEFAULTSORT"

From Disobiki
Jump to navigation Jump to search
(Created page with '<includeonly>{{#ifeq: {{#pos:{{PAGENAME}}|A }} | 0 | {{DEFAULTSORT:{{#replace:{{PAGENAME}}|A |}}, A}} | }} {{#ifeq: {{#pos:{{PAGENAME}}|The }} | 0 | {{DEFAULTSORT:{{#replace:…')
 
Line 1: Line 1:
<includeonly>{{#ifeq: {{#pos:{{PAGENAME}}|A }} | 0 |
+
<includeonly>{{#ifeq: {{#pos:{{PAGENAME}}|A&nbsp;}} | 0 |
   {{DEFAULTSORT:{{#replace:{{PAGENAME}}|A |}}, A}}
+
   {{DEFAULTSORT:{{#replace:{{PAGENAME}}|A&nbsp;|}}, A}}
 
| }}
 
| }}
{{#ifeq: {{#pos:{{PAGENAME}}|The }} | 0 |
+
{{#ifeq: {{#pos:{{PAGENAME}}|The&nbsp;}} | 0 |
   {{DEFAULTSORT:{{#replace:{{PAGENAME}}|The |}}, The}}
+
   {{DEFAULTSORT:{{#replace:{{PAGENAME}}|The&nbsp;|}}, The}}
 
| }}</includeonly><noinclude>
 
| }}</includeonly><noinclude>
 
==Usage==
 
==Usage==

Revision as of 09:29, 14 August 2010

Usage

Given "The Sinful Dwarf", return {{DEFAULTSORT:Sinful Dwarf, The}}. Handles "A Fistful of Dollars" too.
It's not perfect: if "The" or "A" (capitalized) appear elsewhere in title, it'll remove those from the DEFAULTSORT result.

 {{AutoDEFAULTSORT}}