Difference between revisions of "Template:Counter"

From Geohashing
imported>Jevanyn
imported>Jevanyn
Line 14: Line 14:
 
{{#var:countername}}
 
{{#var:countername}}
 
<br>
 
<br>
 +
{{#var:hellospace}}
 +
{{#vardefine:hellospace}}
 +
{{#var:hellospace}}
 +
<br>
 +
{{#vardefine:countername|counterx{{{1}}}}}
 +
{{#if:{{#var:{{#var:countername}}}}
 +
|#var:{{#var:countername}}
 +
|
 +
}}
 
{{#var:counterx_{{{1}}}|#var:counterx_{{{1}}}={{#expr:{{#if#var:counterx_{{{1}}}+1|#var:counterx_{{{1}}}=1}}{{#var:counterx_{{{1}}} }}
 
{{#var:counterx_{{{1}}}|#var:counterx_{{{1}}}={{#expr:{{#if#var:counterx_{{{1}}}+1|#var:counterx_{{{1}}}=1}}{{#var:counterx_{{{1}}} }}

Revision as of 20:08, 17 March 2015

This is a test template, to make something that can count the number of times it can be included on a page. Ultimately I'll be using it on this wiki as well as Wikipedia.
hello world


hello moon hello moon
yes moon no star


counter




{{#var:counterx_{{{1}}}|#var:counterx_{{{1}}}={{#expr:{{#if#var:counterx_{{{1}}}+1|#var:counterx_{{{1}}}=1}}