User:B1KWikis/if
This page is a work in progress |
STILL Under construction: Mild testing - Final Stages/Awaiting approval.
Code breaks down as follows:
{{ #if: {{{1|}}} | [then print] "{{#if:{{{ {{{1}}}| }}} }}" }}
meaning:
if variable X is given, then display "if X" with the code stuff around it, instantly making life easier!
This is a Template for Templates that use the IF operator. To make you life easier. To be honest, I didn't think I'd actually get this darn thing to work, but I did.[1] However, since this is a template for a template, make sure to give the full instance of the name (e.g. {{Template:if}}) if it doesn't work properly. It should, however, work anyways.
The usage implies that this would be put inside template using the if operator, replacing "{{#if:{{{X|}}}|<>}}" with "{{if|X}} <>[2]", X being any normal counting number, like 1, 2, 3, or even 156000[3].
How does this work?[edit | edit source]
In a template, when you want around, say, 30 different If variables, but you just do NOT
want to spend countless hours typing all that #if: stuff, then this will SAVE.YOUR.LIFE!
It performs the same relative function as but you can easily shorten all that mess (it REALLY can add up) by simply using
To use: (assuming I put this in the mainspace) place {{if|1}}, then {{{1}}} in whatever context, and BOOM the template should work like a charm. For 2, use {{if|2}} {{{2}}}. 3? No problem, just place {{if|3}} {{{3}}}. If you want something like Whoops, place '''Whoops!''' Maybe you were looking for '''[[{{{1}}}]]'''? {{if|2}} How about '''[[{{{2}}}]]'''? {{if|3}} Or maybe even '''[[{{{3}}}]]'''? This would produce[4]:
Whoops! Maybe you were looking for A? How about B? Or maybe even C?
This may seem extremely complicated, but really, the bare basics include using "{{if|1}} '''{{{1}}}''' " in the template, and then using THAT template in another page as "{{Example|Banana Screw}}" to display Banana Screw
Please, somebody study my code and explain it better when(if(hopefully)) I put it on the mainspace.