Difference between revisions of "Template:Pagecount"
Jump to navigation
Jump to search
m (Protected "Template:Pagecount" [edit=autoconfirmed:move=autoconfirmed]) |
m (minor formatting corrections) |
||
Line 2: | Line 2: | ||
===Parameters=== | ===Parameters=== | ||
Note: these specifications use and logic; that is, the template will only include pages that match ''all'' of the specified conditions. | Note: these specifications use 'and' logic; that is, the template will only include pages that match ''all'' of the specified conditions. | ||
{|border="1" cellpadding="2" | {|border="1" cellpadding="2" | ||
Line 25: | Line 25: | ||
|} | |} | ||
<nowiki>*</nowiki> 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 [http://www.tin.org/bin/man.cgi?section=7&topic=regex | <nowiki>*</nowiki> 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 [http://www.tin.org/bin/man.cgi?section=7&topic=regex Perl regular expression syntax] in assigning these values. | ||
===Examples=== | ===Examples=== | ||
Line 31: | Line 31: | ||
:{{Pagecount|category=glossary}} | :{{Pagecount|category=glossary}} | ||
<br/> | <br/> | ||
<code><nowiki>{{Pagecount</nowiki><br/><nowiki>|category=spaceships</nowiki><br/><nowiki>|template = spaceship</nowiki><br/><nowiki>|param = synthesisRLE</nowiki><br/><nowiki>|value = true</nowiki><br/><nowiki>}}</nowiki></code> | <code><nowiki>{{Pagecount</nowiki><br/><nowiki>|category = spaceships</nowiki><br/><nowiki>|template = spaceship</nowiki><br/><nowiki>|param = synthesisRLE</nowiki><br/><nowiki>|value = true</nowiki><br/><nowiki>}}</nowiki></code> | ||
:{{Pagecount|category=spaceships|template=spaceship|param=synthesisRLE|value=true}} | :{{Pagecount|category=spaceships|template=spaceship|param=synthesisRLE|value=true}} | ||
<br/> | <br/> | ||
The template call | The template call can be surrounded by text:<br/> | ||
:There are {{Pagecount|category=spaceships|template=spaceship|param=synthesisRLE|value=true}} spaceships with known glider syntheses. | :There are {{Pagecount|category=spaceships|template=spaceship|param=synthesisRLE|value=true}} spaceships with known glider syntheses. | ||
</noinclude> | </noinclude> |
Revision as of 02:25, 19 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
}}
- 40
The template call can be surrounded by text:
- There are 40 spaceships with known glider syntheses.