模板:Autoinc
This template displays a number that is automatically incremented by 1 every time it is transcluded on a page.
Usage
{{ autoinc | key = <value key> | prefix = <value prefix> (optional) | value = <manual value> (optional) }}
{{ autoinc | <value key> | <value prefix> (optional) | <manual value> (optional) }}
- First unnamed parameter or key
Identifier for the value. This allows using the template for multiple values on the same page.
- Second unnamed parameter or prefix
Text that to be displayed in front of the value.
- Third unnamed parameter or value
Manual value for this transclusion, can be any valid {{#expr:}}
string. The next transclusion continues from there.
Example
Code | Result |
---|---|
|
|
|
|
|
|
|
|
* 0: {{autoinc|loopcounter|value=-2.5}} {{#loop:i|1|6|<nowiki/> * {{#var:i}}: {{autoinc|loopcounter}} }} |
|