Template:Cat: Difference between revisions

From ChoralWiki
Jump to navigation Jump to search
mNo edit summary
(documentation updated)
Line 4: Line 4:
<center><big>'''Documentation'''</big></center>
<center><big>'''Documentation'''</big></center>


This template simultaneously categorizes a page in a category and provides a link to that category. It has one '''required parameter''' (the target category) and up to two '''optional parameters''' (one providing an alternate way of displaying the link, the other for providing a sort key for the categorization). It extends the previous usage/syntax of Template:Cat (making it unnecessary to change existing invocations of the template).
This template simultaneously categorizes a page in a category and provides a link to that category. It has one '''required parameter''' (the target category) and up to two '''optional parameters''' (one providing an alternate way of displaying the link, the other for providing a sort key for the categorization). Note that for linking & categorizing a voicing inside a Works page, the template {{tl|Vcat}} should be used instead.


'''Syntax, with the one required paramter:'''
'''Syntax, with the one required paramter:'''
: <tt><nowiki>{{Cat|<category name>}}</nowiki></tt>
:{{tl|Cat|<category name>}}
which is equivalent to inserting
which is equivalent to inserting
: <tt><nowiki>[[:Category:<category name>|<category name>]][[Category:<category name>]]</nowiki></tt>
: <tt><nowiki>[[:Category:<category name>|<category name>]][[Category:<category name>]]</nowiki></tt>
Line 15: Line 15:


'''Syntax, with required and first optional parameters:'''
'''Syntax, with required and first optional parameters:'''
: <tt><nowiki>{{Cat|<category name>|<displayed text>}}</nowiki></tt>
:{{tl|Cat|<category name>|<displayed text>}}
(note this is exactly the same as the previous syntax of Template:Cat) or
or
: <tt><nowiki>{{Cat|<category name>|2=<displayed text>}}</nowiki></tt>
:{{tl|Cat|<category name>|2{{=}}<displayed text>}}
either of which is equivalent to inserting
either of which is equivalent to inserting
: <tt><nowiki>[[:Category:<category name>|<displayed text>]][[Category:<category name>]]</nowiki></tt>
: <tt><nowiki>[[:Category:<category name>|<displayed text>]][[Category:<category name>]]</nowiki></tt>
Line 25: Line 25:


For example,
For example,
: <tt><nowiki>{{Cat|German texts|Texte auf Deutsch}}</nowiki></tt>
:{{tl|Cat|German texts|Texte auf Deutsch}}
results in the link being displayed as:
results in the link being displayed as:


Line 31: Line 31:


'''Syntax, with required and both optional parameters (for advanced users):'''
'''Syntax, with required and both optional parameters (for advanced users):'''
: <tt><nowiki>{{Cat|<category name>|<displayed text>|sort=<sort key>}}</nowiki></tt>
:{{tl|Cat|<category name>|<displayed text>|sort{{=}}<sort key>}}


which is equivalent to inserting
which is equivalent to inserting
Line 40: Line 40:
</div>
</div>


[[Category:Templates|{{PAGENAME}}]]
[[Category:Templates]]
</noinclude>
</noinclude>

Revision as of 00:25, 15 April 2013

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


Documentation

This template simultaneously categorizes a page in a category and provides a link to that category. It has one required parameter (the target category) and up to two optional parameters (one providing an alternate way of displaying the link, the other for providing a sort key for the categorization). Note that for linking & categorizing a voicing inside a Works page, the template {{Vcat}} should be used instead.

Syntax, with the one required paramter:

{{Cat|<category name>}}

which is equivalent to inserting

[[:Category:<category name>|<category name>]][[Category:<category name>]]

into a file, and the link is displayed as:

<category name>

Syntax, with required and first optional parameters:

{{Cat|<category name>|<displayed text>}}

or

{{Cat|<category name>|2=<displayed text>}}

either of which is equivalent to inserting

[[:Category:<category name>|<displayed text>]][[Category:<category name>]]

into a file and is displayed as:

<displayed text>

For example,

{{Cat|German texts|Texte auf Deutsch}}

results in the link being displayed as:

Texte auf Deutsch

Syntax, with required and both optional parameters (for advanced users):

{{Cat|<category name>|<displayed text>|sort=<sort key>}}

which is equivalent to inserting

[[:Category:<category name>|<displayed text>]][[Category:<category name>|<sort key>]]

into a file. The category <category name> is referenced with the <sort key>, and the link displayed as:

<displayed text>