Template:Pcat

From ChoralWiki
Jump to: navigation, search

[[:Category:{{{1}}}{{{2}}}|{{{1}}}]]

Documentation

This template (think PluralCat) is similar to Template:Cat in that it simultaneously categorizes a page in a category and provides a link to that category. However, it is intended for categories which are plural (such as Category:Masses) and for which the link to the category is displayed as singular (eg. Mass). It has two required parameters (the singular form of the category name and the plural ending for the category name) and an optional parameter (for providing a sort key for the categorization).

Syntax, with the two required paramters:

{{Pcat|<singular part>|<plural ending>}}

which is equivalent to inserting

[[:Category:<singular part><pluralending>|<singular part>]][[Category:<singular part><pluralending>]]

into a file, and the link is displayed as:

<singular part>

Syntax, with two required parameters and the optional sort parameter:

{{Pcat|<singular part>|<plural ending>|9=<sort key>}}

which is equivalent to inserting

[[:Category:<singular part><pluralending>|<singular part>]][[Category:<singular part><pluralending>|<sort key>]]

into a file and is still displayed as above, but the category receives <sort key> as its sort key (instead of the default category name <singular part><plural ending>.

For example,

{{Pcat|Mass|es}}

or

{{Pcat|Mass|es| English masses}}

both result in the link the page being categorized in Category:Masses with the link being displayed as:

Mass

But in the second case, the sort key for the categorization is " English masses".

Note: There are other instances where the structure of this template is useful. As an example:

{{Pcat|Secular| music}}

categorizes a page in Secular music, but the link to Category:Secular music is displayed as Secular.