Template:WorkSorter: Difference between revisions

From ChoralWiki
Jump to navigation Jump to search
(expanded documentation)
(Added Dutch articles as suggested by Joachim on http://forums.cpdl.org/phpBB3/search.php?keywords=indefinite)
Line 10: Line 10:
|lo|los|las<!-- Spanish -->
|lo|los|las<!-- Spanish -->
|il|i|gli<!-- Italian -->
|il|i|gli<!-- Italian -->
|de|het|een<!-- Dutch -->
|as|o|os<!-- Portuguese --> = {{ucfirst: {{#sub:{{{1|{{PAGENAME}}}}}|{{#pos:{{{1|{{PAGENAME}}}}}|{{#explode:{{{1|{{PAGENAME}}}}}||1}} }} }} }}
|as|o|os<!-- Portuguese --> = {{ucfirst: {{#sub:{{{1|{{PAGENAME}}}}}|{{#pos:{{{1|{{PAGENAME}}}}}|{{#explode:{{{1|{{PAGENAME}}}}}||1}} }} }} }}
|#default = {{#switch: {{lc:{{#explode:{{{1|{{PAGENAME}}}}}|&#39;|0}} }}
|#default = {{#switch: {{lc:{{#explode:{{{1|{{PAGENAME}}}}}|&#39;|0}} }}

Revision as of 10:21, 26 January 2016

Documentation

This template removes numerals, most definite and some indefinite articles from the beginning of a work title:

  • Numerals from 1 to 100
  • English articles: the a an
  • French articles: la le l' les un ung une un'
  • German articles: das die der den dem
  • Italian articles: il lo la l' i gli le
  • Portuguese articles: o a os as
  • Spanish articles: lo la los las

Syntax:

{{WorkSorter}}

returns the contents of {{PAGENAME}} after processing it.

Syntax with an optional parameter:

{{WorkSorter|Ung jour viendra (Nicolas Gombert)}}

returns "Jour viendra (Nicolas Gombert)"


This template can be used as a parameter for the magic word DEFAULTSORT in works pages, to produce an appropriate sort key.

{{DEFAULTSORT:{{WorkSorter}}}}

See also