Template:WorkSorter: Difference between revisions

From ChoralWiki
Jump to navigation Jump to search
(more articles)
No edit summary
(3 intermediate revisions by 2 users not shown)
Line 6: Line 6:
|81|82|83|84|85|86|87|88|89|90|91|92|93|94|95|96|97|98|99|100
|81|82|83|84|85|86|87|88|89|90|91|92|93|94|95|96|97|98|99|100
|the|a|an<!-- English -->
|the|a|an<!-- English -->
|das|die|der|den|dem<!-- German -->
|das|die|der|den|dem|ein|eine<!-- German -->
|la|le|les|un|ung|une<!-- French -->
|la|le|les|un|ung|une|des|li<!-- French -->
|lo|los|las<!-- Spanish -->
|el|la|los|las|un|una|unos|unas<!-- Spanish -->
|il|i|gli<!-- Italian -->
|il|la|le|i|gli|un|uno|una<!-- Italian -->
|as|o|os<!-- Portuguese --> = {{ucfirst: {{#sub:{{{1|{{PAGENAME}}}}}|{{#pos:{{{1|{{PAGENAME}}}}}|{{#explode:{{{1|{{PAGENAME}}}}}||1}} }} }} }}
|de|het|een<!-- Dutch -->
|a|as|o|os|um|uma<!-- 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}} }}
|l|un = {{ucfirst: {{#sub:{{{1|{{PAGENAME}}}}}|{{#pos:{{{1|{{PAGENAME}}}}}|{{#explode:{{{1|{{PAGENAME}}}}}|&#39;|1}} }} }} }}
|l|un = {{ucfirst: {{#sub:{{{1|{{PAGENAME}}}}}|{{#pos:{{{1|{{PAGENAME}}}}}|{{#explode:{{{1|{{PAGENAME}}}}}|&#39;|1}} }} }} }}
|#default = {{{1|{{PAGENAME}}}}}
|#default = {{{1|{{PAGENAME}}}}}
}} }}</includeonly><noinclude><!--
}} }}</includeonly><noinclude><!--
-->{{DisplayBox|bgcolor=g|text=
-->{{DisplayBox|title=Documentation|text=
A simple template that removes initial numerals and articles from the work title.
This template removes numerals, most definite and some indefinite articles from the beginning of a work title:
* Numerals from <tt>1</tt> to <tt>100</tt>
* Dutch articles: <tt>de het een</tt>
* English articles: <tt>the a an</tt>
* French articles: <tt>la le l' les un ung une un'</tt>
* German articles: <tt>das die der den dem ein eine </tt>
* Italian articles: <tt>il la le l' i gli un uno una</tt>
* Portuguese articles: <tt>o a os as um uma</tt>
* Spanish articles: <tt>el la los las un uno una unos unas</tt>


'''Syntax:'''
'''Syntax:'''
: <tt><nowiki>{{WorkSorter}}</nowiki></tt> returns the contents of <tt><nowiki>{{PAGENAME}}</nowiki></tt> after processing it.
: <tt><nowiki>{{WorkSorter}}</nowiki></tt>
returns the contents of <tt><nowiki>{{PAGENAME}}</nowiki></tt> after processing it.


'''Syntax with an optional parameter:'''
'''Syntax with an optional parameter:'''
: <tt><nowiki>{{WorkSorter|2 Tantum Ergo (Franz Schöpf)}}</nowiki></tt> returns "{{WorkSorter|2 Tantum Ergo (Franz Schöpf)}}"
: <tt><nowiki>{{WorkSorter|Ung jour viendra (Nicolas Gombert)}}</nowiki></tt>
returns "{{WorkSorter|Ung jour viendra (Nicolas Gombert)}}"




This template can be used in conjunction with the magic word <tt><nowiki>DEFAULTSORT</nowiki></tt> inside Works pages, to produce an appropriate sort key.
This template can be used as a parameter for the magic word <tt><nowiki>DEFAULTSORT</nowiki></tt> in works pages, to produce an appropriate sort key.


: <tt><nowiki>{{DEFAULTSORT:{{WorkSorter}}}}</nowiki></tt>
: <tt><nowiki>{{DEFAULTSORT:{{WorkSorter}}}}</nowiki></tt>
===See also===
*{{tl|NameSorter}}
}}
}}
[[Category:Templates|{{PAGENAME}}]]
 
[[Category:Templates]]
</noinclude>
</noinclude>

Revision as of 14:44, 28 October 2018

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

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