Template:NameSorter: Difference between revisions
Jump to navigation
Jump to search
Documentation
(using LastNameFirst) |
(updated doc) |
||
Line 1: | Line 1: | ||
<includeonly>{{StripAccents|{{LastNameFirst|{{{1|{{PAGENAME}} }}} }} }}</includeonly><noinclude><!-- | <includeonly>{{StripAccents|{{LastNameFirst|{{{1|{{PAGENAME}} }}} }} }}</includeonly><noinclude><!-- | ||
-->{{DisplayBox| | -->{{DisplayBox|title=Documentation|text= | ||
Converts a text in the form "Name(s) Surname" to the form "Surname, Name(s)", removing all diacritics in the process. | Converts a text in the form "Name(s) Surname" to the form "Surname, Name(s)", removing all diacritics in the process. | ||
'''Syntax:''' | '''Syntax:''' | ||
* | * {{tl|NameSorter}} returns the contents of <tt><nowiki>{{PAGENAME}}</nowiki></tt> after processing it. | ||
'''Syntax with an optional parameter:''' | '''Syntax with an optional parameter:''' | ||
* | * {{tl|NameSorter|Antonín Dvořák}} returns "{{NameSorter|Antonín Dvořák}}" | ||
This template is meant to be used | This template is meant to be used as a parameter for the magic word <tt><nowiki>DEFAULTSORT</nowiki></tt> inside Composer and Editor pages, producing an appropriate sort key. | ||
* <tt><nowiki>{{DEFAULTSORT:{{NameSorter}}}}</nowiki></tt> | * <tt><nowiki>{{DEFAULTSORT:{{NameSorter}}}}</nowiki></tt> | ||
In the | In the situations where the normal usage of this template would render an incorrect sort key (as for example "Rue, Pierre de la"), use a textual key instead: | ||
* <tt><nowiki>{{DEFAULTSORT:La Rue, Pierre de}}</nowiki></tt> | * <tt><nowiki>{{DEFAULTSORT:La Rue, Pierre de}}</nowiki></tt> | ||
===See also=== | |||
*[[Template:LastNameFirst]] | |||
*[[Template:StripAccents]] | |||
}} | }} | ||
[[Category:Text formatting templates]] | [[Category:Text formatting templates]] | ||
</noinclude> | </noinclude> |
Latest revision as of 12:58, 20 May 2013
Converts a text in the form "Name(s) Surname" to the form "Surname, Name(s)", removing all diacritics in the process.
Syntax:
- {{NameSorter}} returns the contents of {{PAGENAME}} after processing it.
Syntax with an optional parameter:
- {{NameSorter|Antonín Dvořák}} returns "Dvorak, Antonin "
This template is meant to be used as a parameter for the magic word DEFAULTSORT inside Composer and Editor pages, producing an appropriate sort key.
- {{DEFAULTSORT:{{NameSorter}}}}
In the situations where the normal usage of this template would render an incorrect sort key (as for example "Rue, Pierre de la"), use a textual key instead:
- {{DEFAULTSORT:La Rue, Pierre de}}