Difference between revisions of "Module:SortName/doc"

From blackwiki
Jump to navigation Jump to search
blackwiki>Bility
(doc page)
 
blackwiki>Edgars2007
Line 8: Line 8:
 
;Usage
 
;Usage
 
This module should be [[WP:SUBST|subst'd]] for use in template parameters that accept a sortkey or in the <code><nowiki>{{</nowiki>DEFAULTSORT}}</code> variable.
 
This module should be [[WP:SUBST|subst'd]] for use in template parameters that accept a sortkey or in the <code><nowiki>{{</nowiki>DEFAULTSORT}}</code> variable.
*'''No input''' (sorts the pages title): <code><nowiki>{{</nowiki>subst:#invoke|SortName|sortname}}</code>
+
*'''No input''' (sorts the pages title): <code><nowiki>{{</nowiki>subst:#invoke:SortName|sortname}}</code>
*'''With input''': <code><nowiki>{{</nowiki>subst:#invoke|SortName|sortname|input string}}</code>
+
*'''With input''': <code><nowiki>{{</nowiki>subst:#invoke:SortName|sortname|input string}}</code>

Revision as of 18:36, 4 May 2016

{{#invoke:SortName|function}}

This module returns a string in a format suitable as a category sortkey, per WP:NAMESORT.

Input

The module accepts a string as the first and only unnamed parameter, but is meant to be used with no parameter, in which case the title of the calling page is used.

Usage

This module should be subst'd for use in template parameters that accept a sortkey or in the {{DEFAULTSORT}} variable.

  • No input (sorts the pages title): {{subst:#invoke:SortName|sortname}}
  • With input: {{subst:#invoke:SortName|sortname|input string}}