Template:Pcat: Difference between revisions

From ChoralWiki
Jump to navigation Jump to search
(add documentation)
m (remove extra >, add another example)
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}}}]][[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">
<center><big>'''Documentation'''</big></center>
<center><big>'''Documentation'''</big></center>


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>

Revision as of 07:33, 2 April 2008

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

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>|<singular part><pluralending>]]

into a file, and the link is displayed as:

<singular part>

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

{{Pcat|<singular part>|<plural ending>|<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 Template:CiteCat:Secular music.