Difference between revisions of "Template:Category link with count"

From blackwiki
Jump to navigation Jump to search
test>Zyxw
(If parameter 1 starts with "Category:", remove it. This prevents red links, such as Category:Category:ABC.)
test>Zyxw
(use different method to remove "Category:", previous method did not work with names such as Category:Côte-d'Or)
Line 1: Line 1:
[[:Category:{{PAGENAME:{{{1}}}}}]]&nbsp;({{PAGESINCATEGORY:{{PAGENAME:{{{1}}}}}|{{{2|all}}}}})<noinclude>
+
[[:Category:{{#ifeq:{{str left|{{{1}}}|9}}|Category:|{{str right|{{{1}}}|9}}|{{{1}}}}}]]&nbsp;({{PAGESINCATEGORY:{{#ifeq:{{str left|{{{1}}}|9}}|Category:|{{str right|{{{1}}}|9}}|{{{1}}}}}|{{{2|all}}}}})<noinclude>
 
{{Documentation|Template:Clc/doc}}
 
{{Documentation|Template:Clc/doc}}
 
[[Category:Internal category-link templates]]
 
[[Category:Internal category-link templates]]
 
</noinclude>
 
</noinclude>

Revision as of 19:00, 2 July 2017

[[:Category:{{{1}}}]] (0)

Template documentation[view] [edit] [history] [purge]

Template:Category link with count generates a link to a category followed by the number of pages in the category. It uses the PAGESINCATEGORY parser function.

Usage

One parameter

  • {{Category link with count|CATEGORY}}
  • {{clc|CATEGORY}}
  • {{CLC|CATEGORY}}

Two parameters

  • {{Category link with count|CATEGORY|TYPE}}
  • {{clc|CATEGORY|TYPE}}
  • {{CLC|CATEGORY|TYPE}}

Name label

Examples

Using the template shortcut {{clc}}:

One parameter

Without "Category:"

With "Category:"

Two parameters

Without "Category:"

With "Category:"

See also

Template Example output
{{c}} Example
{{cl}} Category:Example
{{cls}} Cat:Example
Template Example output
{{cconly}} Template:Cconly
{{clc}} Category:Example (0)
{{lc}} Category:Example (edit | talk | history | links | watch | logs)
{{lcs}} Category:Example(edit talk links history)