Difference between revisions of "Template:Variable"
Jump to navigation
Jump to search
(Added third parameter to show a second Type of the variable, in parentheses, and using the {{incode}} template for code. Also changed the size, to be relative, instead of fixed.) |
(The fourth argument is optional, to specify a modifier to the first type.) |
||
(2 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
{{#if:{{{2|}}} | {{#if:{{{2|}}} | ||
− | |<span style="font-size: | + | |<span style="font-size:60%; padding-right:0.8em;">{{{2}}}{{#if:{{{4|}}} |
+ | |<span style="font-style:italic;"> ({{{4}}})</span> | ||
+ | |}}</span> | ||
|}}'''{{{1}}}'''{{#if:{{{3|}}} | |}}'''{{{1}}}'''{{#if:{{{3|}}} | ||
− | + | |<span style="font-size:80%;"> ({{incode|{{{3}}}}})</span> | |
− | + | |}}<noinclude> | |
---- | ---- | ||
Line 20: | Line 22: | ||
---- | ---- | ||
− | + | The second argument is optional, to specify a type to be shown before the variable. | |
Example: | Example: | ||
Line 33: | Line 35: | ||
---- | ---- | ||
− | + | The third argument is optional, to specify a second type to be shown after the variable. | |
<nowiki> | <nowiki> | ||
Line 41: | Line 43: | ||
{{Variable|MyAttribute|Type|Type2}}: some variable. | {{Variable|MyAttribute|Type|Type2}}: some variable. | ||
+ | |||
+ | ---- | ||
+ | |||
+ | The fourth argument is optional, to specify a modifier to the first type. | ||
+ | |||
+ | <nowiki> | ||
+ | {{Variable|MyAttribute|Type|Type2|Mod1}}: some variable. | ||
+ | {{Variable|MyAttribute|Type||Mod1}}: some variable.</nowiki> | ||
+ | |||
+ | Result: | ||
+ | |||
+ | {{Variable|MyAttribute|Type|Type2|Mod1}}: some variable. | ||
+ | |||
+ | {{Variable|MyAttribute|Type||Mod1}}: some variable. | ||
[[Category:Template:Text Format]] | [[Category:Template:Text Format]] | ||
[[Category:Administration]] | [[Category:Administration]] | ||
</noinclude> | </noinclude> |
Latest revision as of 07:49, 18 January 2020
{{{1}}}
Use this template where you want to show a value or parameter.
Example:
{{Variable|MyAttribute}}: some variable.
Result:
MyAttribute: some variable.
The second argument is optional, to specify a type to be shown before the variable.
Example:
{{Variable|MyAttribute|Type}}: some variable.
Result:
TypeMyAttribute: some variable.
The third argument is optional, to specify a second type to be shown after the variable.
{{Variable|MyAttribute|Type|Type2}}: some variable.
Result:
TypeMyAttribute (Type2
): some variable.
The fourth argument is optional, to specify a modifier to the first type.
{{Variable|MyAttribute|Type|Type2|Mod1}}: some variable. {{Variable|MyAttribute|Type||Mod1}}: some variable.
Result:
Type (Mod1)MyAttribute (Type2
): some variable.
Type (Mod1)MyAttribute: some variable.