Difference between revisions of "Template:Cat tag"

From The Coppermind
Jump to navigation Jump to search
m (+css)
m
 
(One intermediate revision by one other user not shown)
Line 4: Line 4:
   
 
CATEGORY
 
CATEGORY
-->{{#if:{{{key|}}}|[[category:{{{1}}}|{{{key}}}]]|[[category:{{{1}}}]]}}<!--
+
-->{{#if:{{{key|}}}|{{cat ns|{{{1}}}|key={{{key}}}}}|{{cat ns|{{{1}}}}}}}<!--
   
 
--></span><noinclude>[[category: link macros]]
 
--></span><noinclude>[[category: link macros]]
Line 37: Line 37:
 
<!-- -------- -->
 
<!-- -------- -->
 
{{docs/row/optional
 
{{docs/row/optional
|param={{2}}
+
|param=<nowiki>{{2}}</nowiki>
 
|desc=Use this to change the link text to something other than the category name
 
|desc=Use this to change the link text to something other than the category name
 
|eg=
 
|eg=

Latest revision as of 21:58, 20 November 2022

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

This template automatically adds a link to a category, and the category itself to a page.

Template[edit]

Note: Replace {{1}} & optionally {{2}} with an actual parameter.

{{cat tag| {{1}} | {{2}} }}

Parameters[edit]

Highlighted lines indicate mandatory parameters.

Positional parameters are indicated with {{N}} in their name. For example, {{1}} means "the first template parameter".

{{cat tag}} Parameters
Parameter Description Examples
{{1}} Use the first parameter to add the page to a category and link to that category.

|Diagram

{{2}} Use this to change the link text to something other than the category name

|...

Articles using Template[edit]