Template:C: Difference between revisions
Template page
More actions
add pipetrick |
m expansion |
||
| Line 1: | Line 1: | ||
[[:Category:{{{1}}}|{{{2|{{{1}}}}}}] | {{#ifexist:Category:{{{1}}}|[[:Category:{{{1}}}|{{#if:{{{2|}}}|{{{2}}}|{{{1}}}}}]]|{{#ifeq:{{{3|}}}|X|<span style="background-color:#FEDBCA">{{#if:{{{2|}}}|{{{2}}}|{{{1}}}}}</span>|[[''Category'':{{#if:{{{2|}}}|{{{2}}}|{{{1}}}}}]]}}}}<noinclude> | ||
<hr/> | <hr/> | ||
;usage | ;usage | ||
:Template will | :Template will display <code> <nowiki>{{{2}}}</nowiki> </code>, or just the category name given as <code> <nowiki>{{{1}}}</nowiki> </code>. | ||
:If the category {{{1}}} does not exist no link will be generated; | |||
::<span style="background-color:#FEDBCA"><nowiki>{{{1}}}</nowiki></span> or <span style="background-color:#FEDBCA"><nowiki>{{{2}}}</nowiki></span> will get background color when {{{3}}} = X | |||
::else [[''Category'':{{{1}}}]] or [[''Category'':{{{2}}}]] is displayed. | |||
<!-- | |||
<pre> | <pre> | ||
code implemented as: | code implemented as: | ||
| Line 12: | Line 14: | ||
</pre> | </pre> | ||
;example | |||
*{{C|Internal link templates}} | |||
*{{C|Internal link templates|}} | |||
*{{C|Internal link templates|display}} | |||
*{{C|not-existing-cat}} | |||
*{{C|not-existing-cat|}} | |||
*{{C|not-existing-cat|display}} | |||
*{{C|not-existing-cat|3=X}} | |||
*{{C|not-existing-cat|display|X}} | |||
[[Category:Internal link templates|{{PAGENAME}}]] | [[Category:Internal link templates|{{PAGENAME}}]] | ||
[[Category:Typing-aid templates|{{PAGENAME}}]] | [[Category:Typing-aid templates|{{PAGENAME}}]] | ||
--> | |||
</noinclude> | </noinclude> | ||
Revision as of 20:41, 6 October 2011
[[Category:{{{1}}}]]
- usage
- Template will display
{{{2}}}, or just the category name given as{{{1}}}. - If the category {{{1}}} does not exist no link will be generated;
- {{{1}}} or {{{2}}} will get background color when {{{3}}} = X
- else [[Category:{{{1}}}]] or [[Category:{{{2}}}]] is displayed.