Template:Infobox Template/variables
Infobox Template/variables | |
---|---|
Purpose |
Infobox [list all] |
Single tag |
No [list all] |
Multi-line |
Optional [list all] |
Protected |
No [list all] |
Game related |
No [list all] |
Categorization | |
Suppressible |
Recursively [list all] |
Choice |
Multiple categories [list all] |
Categories |
Multiple: [list all] |
|
|
Variables | |
Names |
One: [list all] |
|
|
Subpages |
This template renders information about another template, a list of variables that are used by it. Depending on the amount of specified variables, this template may also categorize that template under the category that represents that amount. Non variable-using, Variable-using or Multi variable-using.
Parameters
- The name of a variable that the template uses, with an optional source template name if it is inherited, separated by exclamation mark (no parameter name, multiple parameters allowed, case sensitive)
- nocat: Whether or not to suppress categorization under the automatically chosen category (defaults to false, which means auto categorization).
Note: the unnamed parameters must be specified in proper order if using their positional numbers, because the first number that is empty/not specified terminates the list. If the list is empty this way, the default 'none' category will be used.
Note: although this template does not limit the amount of possible unnamed parameters, the parent infobox limits to ten.
Syntax
{{Infobox Template/variables|value!value}}
Warning: this template will often force a table cell to split in two, so do not use it outside table cells! Infoboxes use tables, so in there would be fine.
Examples
Common use includes at least one unnamed parameter to specify the variable name that the template uses:
{{Infobox Template/variables|myVar}}
- One: [list all]
- myVar (free for reuse)
If the template inherits the variable from another template that it uses, the name of the source template may be specified as well, separated with exclamation mark like this:
{{Infobox Template/variables|lba!Infobox Character/adventure}}
You can also specify multiple variables for one template, mixing own and inherited variables:
{{Infobox Template/variables |messages |lba!Infobox Character/adventure }}
Additionally, it is possible to specify that a variable is not allowed to be reused by other templates on the same page, by providing a third value for any unnamed parameter (any value will do):
{{Infobox Template/variables |messages |lba!Infobox Character/adventure!do-not-reuse }}
This is also possible for variables that are not inherited, by specifying two exclamation marks (an empty 2nd value):
{{Infobox Template/variables |messages!!do-not-reuse |lba!Infobox Character/adventure }}
You may leave the "variables" undefined by not specifying any unnamed parameters (specifically the part left of the 1st separator), or not maintaining proper ordering, so these all have the same result:
{{Infobox Template/variables}} {{Infobox Template/variables|}} {{Infobox Template/variables|!someTemplate}} {{Infobox Template/variables|var=somevar!someTemplate}} {{Infobox Template/variables||someVar!someTemplate}} {{Infobox Template/variables|1=someVar!someTemplate|1=}} {{Infobox Template/variables|2=someVar!someTemplate}}
- none [list all]
The nocat parameter may be used to suppress automatic categorization like this (any value will do):
{{Infobox Template/variables|myVar|nocat=true}}
This would render the same result as the first example above, but would not automatically categorize under Category:Variable-using templates.