Template:Pcat: Difference between revisions

From ChoralWiki
Jump to navigation Jump to search
(add documentation)
m (Text replace - "\[\[Category:(.*)\|{{PAGENAME}}]]" to "Category:$1")
 
(6 intermediate revisions by 2 users not shown)
Line 1: Line 1:
[[:Category:{{{1}}}{{{2}}}|{{{1}}}]][[Category:{{{1}}}{{{2}}}|{{{3|{{{1}}}{{{2}}}}}}]]<noinclude>[[Category:Templates|{{PAGENAME}}]]</noinclude>><noinclude><br><br><div><div style="margin: 0; margin-right: 30px; margin-left: 30px; border: 1px solid #3399ff; padding: 1em 1em 1em 1em; background-color:#ddffdd">
[[:Category:{{{1}}}{{{2}}}|{{{1}}}]]<includeonly>[[Category:{{{1}}}{{{2}}}]]</includeonly><noinclude>[[Category:Templates]]</noinclude><noinclude><br><br><div><div style="margin: 0; margin-right: 30px; margin-left: 30px; border: 1px solid #3399ff; padding: 1em 1em 1em 1em; background-color:#ddffdd">
<center><big>'''Documentation'''</big></center>
<center><big>'''Documentation'''</big></center>


Line 7: Line 7:
: <tt><nowiki>{{Pcat|<singular part>|<plural ending>}}</nowiki></tt>
: <tt><nowiki>{{Pcat|<singular part>|<plural ending>}}</nowiki></tt>
which is equivalent to inserting
which is equivalent to inserting
: <tt><nowiki>[[:Category:<singular part><pluralending>|<singular part>]][[Category:<singular part><pluralending>|<singular part><pluralending>]]</nowiki></tt>
: <tt><nowiki>[[:Category:<singular part><pluralending>|<singular part>]][[Category:<singular part><pluralending>]]</nowiki></tt>
into a file, and the link is displayed as:
into a file, and the link is displayed as:


<font color=blue><singular part></font>
<font color=blue><singular part></font>


'''Syntax, with two required parameters and the optional third parameter:'''
'''Syntax, with two required parameters and the optional sort parameter:'''
: <tt><nowiki>{{Pcat|<singular part>|<plural ending>|<sort key>}}</nowiki></tt>
: <tt><nowiki>{{Pcat|<singular part>|<plural ending>|9=<sort key>}}</nowiki></tt>
which is equivalent to inserting
which is equivalent to inserting
: <tt><nowiki>[[:Category:<singular part><pluralending>|<singular part>]][[Category:<singular part><pluralending>|<sort key>]]</nowiki></tt>
: <tt><nowiki>[[:Category:<singular part><pluralending>|<singular part>]][[Category:<singular part><pluralending>|<sort key>]]</nowiki></tt>
Line 28: Line 28:
But in the second case, the sort key for the categorization is "<tt> English masses</tt>".
But in the second case, the sort key for the categorization is "<tt> English masses</tt>".


'''Note: ''' There are other instances where the structure of this template is useful.  As an example:
: <tt><nowiki>{{Pcat|Secular| music}}</nowiki></tt>
categorizes a page in {{CiteCat|Secular music}}, but the link to [[:Category:Secular music]] is displayed as {{CiteCat|Secular music|Secular}}.


</div>
</div>
</noinclude>
</noinclude>

Latest revision as of 06:49, 1 June 2015

[[: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.