Difference between revisions of "Template:Category count only/doc"

(Creation (as this is needed))
 
m (updating)
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
{{Documentation}}
+
{{Documentation subpage}}
 
<!-- Add categories where indicated at the bottom of this page and interwikis at Wikidata -->
 
<!-- Add categories where indicated at the bottom of this page and interwikis at Wikidata -->
 
{{tsh|cconly}}
 
{{tsh|cconly}}
Line 8: Line 8:
 
The first unnamed parameter, mandatory, is the category name to be counted.<br/>
 
The first unnamed parameter, mandatory, is the category name to be counted.<br/>
 
A second unnamed parameter, optional, may be used to count several subsets of that category, as described in [[mw:Help:Magic words#Statistics]].
 
A second unnamed parameter, optional, may be used to count several subsets of that category, as described in [[mw:Help:Magic words#Statistics]].
* {{tlx|Category count only|Wikipedia articles with VIAF identifiers}} → {{Category count only|Wikipedia articles with VIAF identifiers}}
+
* {{tlx|Category count only|Category namespace templates}} → {{Category count only|Category namespace templates}}
* {{tlx|Category count only|Trees|all}} → {{Category count only|Trees|all}}
+
* {{tlx|Category count only|BattleTechWiki|all}} → {{Category count only|BattleTechWiki|all}}
* {{tlx|Category count only|Trees|pages}} → {{Category count only|Trees|pages}}
+
* {{tlx|Category count only|BattleTechWiki|pages}} → {{Category count only|BattleTechWiki|pages}}
* {{tlx|Category count only|Trees|subcats}} → {{Category count only|Trees|subcats}}
+
* {{tlx|Category count only|BattleTechWiki|subcats}} → {{Category count only|BattleTechWiki|subcats}}
* {{tlx|Category count only|Trees|files}} → {{Category count only|Trees|files}}
+
* {{tlx|Category count only|Material Design Icons‎|files}} → {{Category count only|Material Design Icons‎|files}}
  
 
== See also ==
 
== See also ==
Line 20: Line 20:
 
<includeonly>{{sandbox other||
 
<includeonly>{{sandbox other||
 
<!-- Categories below this line; interwikis at Wikidata -->
 
<!-- Categories below this line; interwikis at Wikidata -->
 
+
[[Category:Category namespace templates]]
 
}}</includeonly>
 
}}</includeonly>

Latest revision as of 11:30, 18 January 2024

About[edit]

{{Category count only}} simply returns the number of pages in a category, with no extra surrounding text.

Usage[edit]

The first unnamed parameter, mandatory, is the category name to be counted.
A second unnamed parameter, optional, may be used to count several subsets of that category, as described in mw:Help:Magic words#Statistics.

See also[edit]

Template Example output
{{c}} Help
{{cl}} Category:Help
{{cls}} Cat:Help
Template Example output
{{cconly}} 45
{{clc}} Category:Help (45)
{{lc}} Category:Help (edit | talk | history | links | watch | logs)
{{lcs}} Category:Help (Edit Discussion links Page history)