Difference between revisions of "Template:Pagecount"
Jump to navigation
Jump to search
m (Documentation for a template that I made - It probably won't be very useful.) |
m |
||
| Line 1: | Line 1: | ||
<includeonly>{{#dpl:{{#if:{{{category|}}}|category={{{category}}}}}|{{#if:{{{uses|}}}|uses=Template:{{{uses}}}}}|{{#if:{{{template|}}}|include={{{{template}}}}:%}}|{{#if:{{{param|}}}|includematch=/\{{!}}\s*{{{param}}}\s*=\s*{{{value|}}}/}}|resultsheader=%{{#ifeq:{{{total|}}}|true|TOTAL|}}PAGES%|noresultsheader=0|format={{#if,:,,:|}}}}</includeonly> | <includeonly>{{#dpl:{{#if:{{{category|}}}|category={{{category}}}}}|{{#if:{{{uses|}}}|uses=Template:{{{uses}}}}}|{{#if:{{{template|}}}|include={{{{template}}}}:%}}|{{#if:{{{param|}}}|includematch=/\{{!}}\s*{{{param}}}\s*=\s*{{{value|}}}/}}|resultsheader=%{{#ifeq:{{{total|}}}|true|TOTAL|}}PAGES%|noresultsheader=0|format={{#if,:,,:|}}}}</includeonly><noinclude>This template gives the number of pages that match the specified criteria. This should be used ''sparingly''. | ||
<noinclude> | |||
This template gives the number of pages that match the specified criteria. This should be used ''sparingly''. | |||
===Parameters=== | ===Parameters=== | ||
Revision as of 05:15, 13 May 2009
This template gives the number of pages that match the specified criteria. This should be used sparingly.
Parameters
Note: these specifications use and logic; that is, the template will only include pages that match all of the specified conditions.
| category | This includes only pages belonging to the specified category (e.g. category=spaceships). |
| uses | This includes only pages that use the specified template (e.g. uses=spaceship). |
| template | This is the template to be searched when looking for pages that contain template calls with specific parameter values (e.g. template=spaceship). This is not the same as "uses", and will not give a result unless either 'category' or 'uses' are defined. |
| param | This is the parameter that will be searched for in the template call specified by 'template' (e.g. param=synthesisRLE).* This parameter requires 'template' to be defined. |
| value | This specifies the value of the template parameter defined by 'param' and 'template' (e.g. value=true).* For finding pages that have the parameter specified by 'param' with any assigned value, leave the 'value' parameter undefined. This parameter requires 'template' and 'param' to be defined. |
| total | This will output the total number of pages without limitations created by the server if the parameter is given the value 'true' (e.g. total=true). This will negate the effects of 'template', 'param', and 'value'. This is usually used when the specifications are very general, such as category=patterns. |
* There may be some problems with these parameters as the searched template is only matched for text, not actual values. To manipulate the output to give proper results you can use perl regular expression syntax in assigning these values.
Examples
{{Pagecount
|category = glossary
}}
- 500
{{Pagecount
|category=spaceships
|template = spaceship
|param = synthesisRLE
|value = true
}}
- 42
The template call may be surrounded by text:
- There are 42 spaceships with known glider syntheses.