Template:Var: Difference between revisions
Created page with "<includeonly>{{#if:{{{1|}}}|{{{1|}}}|{{{2|}}}}}</includeonly><noinclude>{{Tlx|var}} is used on templates such as the infobox templates, and the summaryboxes which give out a p..." |
(No difference)
|
Latest revision as of 17:22, May 27, 2014
{{{{#if: |subst:}}var{{#if: ||{{{2}}}}}{{#if: ||{{{3}}}}}{{#if: ||{{{4}}}}}{{#if: ||{{{5}}}}}{{#if: ||{{{6}}}}}{{#if: ||{{{7}}}}}{{#if: ||{{{8}}}}}{{#if: ||{{{9}}}}}{{#if: ||{{{10}}}}}{{#if: ||{{{11}}}}}{{#if: ||{{{12}}}}}{{#if: ||{{{13}}}}}{{#if: ||{{{14}}}}}{{#if: ||{{{15}}}}}{{#if: ||{{{16}}}}}{{#if: ||{{{17}}}}}{{#if: ||{{{18}}}}}{{#if: ||{{{19}}}}}{{#if: ||{{{20}}}}}{{#if: ||...}}}} is used on templates such as the infobox templates, and the summaryboxes which give out a pre-formatted set of parameters to display default values properly. Because the pre-formatted set of parameters sets out the variable names using the default value in the form {{{var|default}}} does not work because even if the value is not used the parameter is still named in the template. Using this template a default can be told to show not only when the value is not set, but also if the value is left blank.
Usage[edit]
{{{{#if: |subst:}}var{{#if:variable ||variable}}{{#if:default value ||default value}}{{#if: ||{{{4}}}}}{{#if: ||{{{5}}}}}{{#if: ||{{{6}}}}}{{#if: ||{{{7}}}}}{{#if: ||{{{8}}}}}{{#if: ||{{{9}}}}}{{#if: ||{{{10}}}}}{{#if: ||{{{11}}}}}{{#if: ||{{{12}}}}}{{#if: ||{{{13}}}}}{{#if: ||{{{14}}}}}{{#if: ||{{{15}}}}}{{#if: ||{{{16}}}}}{{#if: ||{{{17}}}}}{{#if: ||{{{18}}}}}{{#if: ||{{{19}}}}}{{#if: ||{{{20}}}}}{{#if: ||...}}}}
- variable is the normal variable used. Be sure to use the | to set the default to nothing so that removing the parameter from the inclusion won't affect the way things are displayed (i.e. use {{{1|}}} for example).
- default value is the default value to be outputed, this would normally be what you would put after the | in a variable call.
- If variable is set to some value then variable will be outputted.
- If variable is unset, or set to nothing but whitespace then default value will be outputted.