Template:Genre: Difference between revisions

From ChoralWiki
Jump to navigation Jump to search
m (add lc: to remaining parameters)
(case does matter for all but initial letter)
 
(26 intermediate revisions by 3 users not shown)
Line 1: Line 1:
<includeonly>{{#switch: {{lc:{{{1}}}}}
<includeonly>{{#switch: {{lc:{{{1|}}}}}
|sacred
|sacred
|secular = '''Genre:''' [[:Category:{{{1}}} music|{{{1}}}]][[Category:{{{1}}} music]]
|secular ='''Genre:''' {{cat|{{{1}}} music|{{{1}}}}}
|dual
|dual
|both = '''Genres:''' [[:Category:Secular music|Secular]] & [[:Category:Sacred music|Sacred]][[Category:Secular music]][[Category:Sacred music]]
|both ='''Genres:''' {{cat|Secular music|Secular}} & {{cat|Sacred music|Sacred}}
|'''Genre:''' [[:Category:{{{1}}} music|{{{1}}}]][[Category:{{{1}}} music]]
| ='''Genre:''' ({{cat|Works with invalid genre|missing}})
}}{{#switch: {{lc:{{{2|}}}}}
|#default ='''Genre:''' [[:Category:Unknown genre|{{{1|Unknown}}}]][[Category:Works with invalid genre]]
|=
}}{{#if:{{{2|}}}
|requiems
|{{Subgenre|{{{2}}}|{{{sort|{{{9|}}}}}}}}|[[Category:Works with invalid subgenre]]<!-- first subgenre must not be empty -->
|communion services =,&nbsp;[[:Category:{{{2}}}|{{#sub: {{{2}}}||-1}}]][[Category:{{{2}}}|{{{sort|{{{9|{{PAGENAME}}}}}}}}]]
}}{{Subgenre|{{{3|}}}|{{{sort|{{{9|}}}}}}
|preces and responses
}}{{Subgenre|{{{4|}}}|{{{sort|{{{9|}}}}}}
|morning canticles
|evening canticles =,&nbsp;[[:Category:{{{2}}}|{{{2}}}]][[Category:{{{2}}}|{{{sort|{{{9|{{PAGENAME}}}}}}}}]]
|liturgical music
|shape notes =,&nbsp;[[:Category:{{{2}}}|{{{2}}}]][[Category:{{{2}}}]]
|lieder =,&nbsp;[[:Category:Lieder|Lied]][[Category:Lieder]]
|masses =,&nbsp;[[:Category:Masses|Mass]][[Category:Masses|{{{sort|{{{9|{{PAGENAME}}}}}}}}]]
|,&nbsp;[[:Category:{{{2}}}|{{#sub: {{{2}}}||-1}}]][[Category:{{{2}}}]]
}}{{#switch: {{lc:{{{3|}}}}}
|=
|requiems
|communion services =,&nbsp;[[:Category:{{{3}}}|{{#sub: {{{3}}}||-1}}]][[Category:{{{3}}}|{{{sort|{{{9|{{PAGENAME}}}}}}}}]]
|preces and responses
|morning canticles
|evening canticles =,&nbsp;[[:Category:{{{3}}}|{{{3}}}]][[Category:{{{3}}}|{{{sort|{{{9|{{PAGENAME}}}}}}}}]]
|liturgical music
|shape notes =,&nbsp;[[:Category:{{{3}}}|{{{3}}}]][[Category:{{{3}}}]]
|lieder =,&nbsp;[[:Category:Lieder|Lied]][[Category:Lieder]]
|masses =,&nbsp;[[:Category:Masses|Mass]][[Category:Masses|{{{sort|{{{9|{{PAGENAME}}}}}}}}]]
|,&nbsp;[[:Category:{{{3}}}|{{#sub: {{{3}}}||-1}}]][[Category:{{{3}}}]]
}}{{#switch: {{lc:{{{4|}}}}}
|=
|requiems
|communion services =,&nbsp;[[:Category:{{{4}}}|{{#sub: {{{4}}}||-1}}]][[Category:{{{4}}}|{{{sort|{{{9|{{PAGENAME}}}}}}}}]]
|preces and responses
|morning canticles
|evening canticles =,&nbsp;[[:Category:{{{4}}}|{{{4}}}]][[Category:{{{4}}}|{{{sort|{{{9|{{PAGENAME}}}}}}}}]]
|liturgical music
|shape notes =,&nbsp;[[:Category:{{{4}}}|{{{4}}}]][[Category:{{{4}}}]]
|lieder =,&nbsp;[[:Category:Lieder|Lied]][[Category:Lieder]]
|masses =,&nbsp;[[:Category:Masses|Mass]][[Category:Masses|{{{sort|{{{9|{{PAGENAME}}}}}}}}]]
|,&nbsp;[[:Category:{{{4}}}|{{#sub: {{{4}}}||-1}}]][[Category:{{{4}}}]]
}}</includeonly><noinclude>
}}</includeonly><noinclude>
{{DisplayBox|bgcolor=g|text=
{{Doc|1=
Creates a text '''Genre:''' with links to genre (options: "Sacred", "Secular", and "Dual" or "Both") and subgenre(s) categories (up to 3 subgenres) and categorizes the work page accordingly.
This template creates a text '''Genre:''' with links to genre (options: "Sacred", "Secular", and "Dual" or "Both") and subgenre(s) categories (up to 3 subgenres), and categorizes the work page accordingly.
;Usage:  
;Normal usage:
*<tt><nowiki>{{Genre|Sacred|Chorales|Carols|<sort=Composer's surname, name>}}</nowiki></tt> or<br> <tt><nowiki>{{Genre|sacred|chorales|carols|<9=Composer's surname, name>}}</nowiki></tt>
*{{tl|Genre|Sacred|Hymns}} <br> ({{tl|Genre|sacred|hymns}} will work too.)
The optional <tt><sort=...></tt> parameter is only required for subgenres "Masses", "Morning Canticles", "Evening Canticles", "Communion Services" and "Preces and Responses"; it must be in the form "Composer's surname, name". All other categories will follow the sort key defined in the DEFAULTSORT of the page, when available.
 
;Usage with a sort key:
*{{tl|Genre|Sacred|Chorales|Carols|sort{{=}}''La Rue, Pierre de''}}
The optional {{para|sort}} parameter is only required for subgenres {{CiteCat|Masses}}, {{CiteCat|Requiems}}, {{CiteCat|Morning Canticles}}, {{CiteCat|Evening Canticles}}, {{CiteCat|Communion Services}} and {{CiteCat|Preces and Responses}}. A standard sort key in the form "Composer's last name, name(s)" is automatically provided by the system. All other genre categories will follow the sort key defined by the page's DEFAULTSORT, when one is set. For composer names that do not follow the standard sorting rule ("last name, name(s)"), a sorting key can be added individually to each works page (as in the example above), or better yet, the composer name can be included as an exception to the Exceptions list of template {{CT|LastNameFirst}}.
 
;Adding new subgenres
The categorization by subgenres is performed inside the {{CT|Subgenre}} template. New subgenres can be added there according to the need.
 
;See also:
*[[ChoralWiki:Subgenres]] – List of subgenres in use
 
}}
}}
[[Category:Templates|{{PAGENAME}}]]
[[Category:Templates]]
</noinclude>
</noinclude>

Latest revision as of 18:02, 4 August 2021


Documentation

This template creates a text Genre: with links to genre (options: "Sacred", "Secular", and "Dual" or "Both") and subgenre(s) categories (up to 3 subgenres), and categorizes the work page accordingly.

Normal usage
  • {{Genre|Sacred|Hymns}}
    ({{Genre|sacred|hymns}} will work too.)
Usage with a sort key
  • {{Genre|Sacred|Chorales|Carols|sort=La Rue, Pierre de}}

The optional |sort= parameter is only required for subgenres Masses, Requiems, Morning Canticles, Evening Canticles, Communion Services and Preces and Responses. A standard sort key in the form "Composer's last name, name(s)" is automatically provided by the system. All other genre categories will follow the sort key defined by the page's DEFAULTSORT, when one is set. For composer names that do not follow the standard sorting rule ("last name, name(s)"), a sorting key can be added individually to each works page (as in the example above), or better yet, the composer name can be included as an exception to the Exceptions list of template LastNameFirst.

Adding new subgenres

The categorization by subgenres is performed inside the Subgenre template. New subgenres can be added there according to the need.

See also