Template:Cat: Difference between revisions

From ChoralWiki
Jump to navigation Jump to search
(documentation updated)
mNo edit summary
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
[[:Category:{{{1}}}|{{{2|{{{1}}}}}}]]<includeonly>[[Category:{{{1}}}{{switch|{{{sort|}}}|case: = |default = {{!}}{{{sort}}}}}]]</includeonly><noinclude>
[[:Category:{{{1}}}|{{{2|{{{1}}}}}}]]<includeonly>[[Category:{{{1}}}{{#if:{{{sort|}}}|{{!}}{{{sort}}}}}]]</includeonly><noinclude>
{{prot-temp}}<br>
{{prot-temp}}<br>
<div><div style="margin: 0; margin-right: 30px; margin-left: 30px; border: 1px solid #3399ff; padding: 1em 1em 1em 1em; background-color:#ddffdd">
{{DisplayBox|title=Documentation|text=
<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). Note that for linking & categorizing a voicing inside a Works page, the template {{tl|Vcat}} should be used instead.
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 parameter:'''
:{{tl|Cat|<category name>}}
:{{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>
into a file, and the link is displayed as:
into a page, and the link is displayed as:


<font color=blue><category name></font>
<font color=blue><category name></font>
Line 20: Line 18:
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>
into a file and is displayed as:
into a page, and is displayed as:


<font color=blue><displayed text></font>
<font color=blue><displayed text></font>
Line 28: Line 26:
results in the link being displayed as:
results in the link being displayed as:


<font color=blue>Texte auf Deutsch</font>
{{Mcat|German texts|Texte auf Deutsch}}


'''Syntax, with required and both optional parameters (for advanced users):'''
'''Syntax, with required and both optional parameters (for advanced users):'''
Line 35: Line 33:
which is equivalent to inserting
which is equivalent to inserting
: <tt><nowiki>[[:Category:<category name>|<displayed text>]][[Category:<category name>|<sort key>]]</nowiki></tt>
: <tt><nowiki>[[:Category:<category name>|<displayed text>]][[Category:<category name>|<sort key>]]</nowiki></tt>
into a file.  The category <category name> is referenced with the <sort key>, and the link displayed as:
into a page.  The category <category name> is referenced with the <sort key>, and the link displayed as:


<font color=blue><displayed text></font>
<font color=blue><displayed text></font>
</div>
}}


[[Category:Templates]]
[[Category:Templates]]
</noinclude>
</noinclude>

Latest revision as of 15:41, 1 February 2019

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

{{Cat|<category name>}}

which is equivalent to inserting

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

into a page, 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 page, 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 page. The category <category name> is referenced with the <sort key>, and the link displayed as:

<displayed text>