Difference between revisions of "Template:WorkSorter"

From ChoralWiki
Jump to navigation Jump to search
(Spanish characters)
Line 14: Line 14:
 
|#default = {{#switch: {{lc:{{#explode:{{{1|{{PAGENAME}}}}}|'|0}} }}
 
|#default = {{#switch: {{lc:{{#explode:{{{1|{{PAGENAME}}}}}|'|0}} }}
 
|l|un = {{ucfirst: {{#sub:{{{1|{{PAGENAME}}}}}|{{#pos:{{{1|{{PAGENAME}}}}}|{{#explode:{{{1|{{PAGENAME}}}}}|'|1}} }} }} }}
 
|l|un = {{ucfirst: {{#sub:{{{1|{{PAGENAME}}}}}|{{#pos:{{{1|{{PAGENAME}}}}}|{{#explode:{{{1|{{PAGENAME}}}}}|'|1}} }} }} }}
 +
|#default = {{#switch: {{#sub:{{{1|{{PAGENAME}}}}}|0|1}}
 +
|¡|¿ = {{#sub:{{{1|{{PAGENAME}}}}}|1}}
 
|#default = {{{1|{{PAGENAME}}}}}
 
|#default = {{{1|{{PAGENAME}}}}}
}} }}</includeonly><noinclude><!--
+
}} }} }}</includeonly><noinclude><!--
 
-->{{DisplayBox|title=Documentation|text=
 
-->{{DisplayBox|title=Documentation|text=
 
This template removes numerals, most definite and some indefinite articles from the beginning of a work title:
 
This template removes numerals, most definite and some indefinite articles from the beginning of a work title:
Line 26: Line 28:
 
* Portuguese articles: <tt>o a os as um uma</tt>
 
* Portuguese articles: <tt>o a os as um uma</tt>
 
* Spanish articles: <tt>el la los las un uno una unos unas</tt>
 
* Spanish articles: <tt>el la los las un uno una unos unas</tt>
 +
* Spanish characters: <tt>¡ ¿</tt>
  
 
'''Syntax:'''
 
'''Syntax:'''

Revision as of 04:50, 22 November 2019

Documentation

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

  • Numerals from 1 to 100
  • Dutch articles: de het een
  • English articles: the a an
  • French articles: la le l' les un ung une un'
  • German articles: das die der den dem ein eine
  • Italian articles: il la le l' i gli un uno una
  • Portuguese articles: o a os as um uma
  • Spanish articles: el la los las un uno una unos unas
  • Spanish characters: ¡ ¿

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