Difference between revisions of "Template:Counter"
From Geohashing
imported>Jevanyn |
imported>Jevanyn |
||
Line 1: | Line 1: | ||
<noinclude>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.</noinclude> | <noinclude>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.</noinclude> | ||
− | < | + | <br> |
− | {{#var:counterx_{{{1}}}|#var:counterx_{{{1}}}={{#expr:{{#if#var:counterx_{{{1}}}+1|#var:counterx_{{{1}}}=1}}{{#var:counterx_{{{1}}} }} | + | {{#vardefine:helloworld|hello world}}{{#var:helloworld}} |
+ | <br> | ||
+ | {{#vardefine:moon|moon}} | ||
+ | {{#vardefine:hello{{#var:moon}}|hello moon}} | ||
+ | {{#var:hellomoon}} | ||
+ | {{#var:hello{{#var:moon}}}} | ||
+ | <br> | ||
+ | {{#if:{{#var:hellomoon|}}|yes moon|no moon}} | ||
+ | {{#if:{{#var:hellostar|}}|yes star|no star}} | ||
+ | |||
+ | {{#vardefine:countername|{{#if:{{{1|}}}|counterx{{{1}}}|counter}}}} | ||
+ | {{#var:countername}} | ||
+ | <br> | ||
+ | {{#var:counterx_{{{1}}}|#var:counterx_{{{1}}}={{#expr:{{#if#var:counterx_{{{1}}}+1|#var:counterx_{{{1}}}=1}}{{#var:counterx_{{{1}}} }} |
Revision as of 12:52, 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}}