Difference between revisions of "Template:Counter"

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

Revision as of 20:15, 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
ab

a1b

a2b


1