Difference between revisions of "Template:Variable"
Jump to navigation
Jump to search
(The condition is more visible) |
(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.) |
||
Line 1: | Line 1: | ||
{{#if:{{{2|}}} | {{#if:{{{2|}}} | ||
− | |<span style="font-size: | + | |<span style="font-size:67%; padding-right:10px;">{{{2}}}</span> |
− | |}}'''{{{1}}}'''<noinclude> | + | |}}'''{{{1}}}'''{{#if:{{{3|}}} |
+ | |<span style="font-size:80%;"> ({{incode|{{{3}}}}})</span> | ||
+ | |}}<noinclude> | ||
+ | |||
---- | ---- | ||
Line 9: | Line 12: | ||
<nowiki> | <nowiki> | ||
− | {{Variable|MyAttribute}}</nowiki> | + | {{Variable|MyAttribute}}: some variable.</nowiki> |
Result: | Result: | ||
− | {{Variable|MyAttribute}} | + | {{Variable|MyAttribute}}: some variable. |
+ | |||
+ | ---- | ||
You can optionally also specify a type to be shown before the variable. | You can optionally also specify a type to be shown before the variable. | ||
Line 20: | Line 25: | ||
<nowiki> | <nowiki> | ||
− | {{Variable|MyAttribute|Type}}</nowiki> | + | {{Variable|MyAttribute|Type}}: some variable.</nowiki> |
+ | |||
+ | Result: | ||
+ | |||
+ | {{Variable|MyAttribute|Type}}: some variable. | ||
+ | |||
+ | ---- | ||
+ | |||
+ | You can optionally also specify a second type to be shown after the variable. | ||
+ | |||
+ | <nowiki> | ||
+ | {{Variable|MyAttribute|Type|Type2}}: some variable.</nowiki> | ||
Result: | Result: | ||
− | {{Variable|MyAttribute|Type}} | + | {{Variable|MyAttribute|Type|Type2}}: some variable. |
[[Category:Template:Text Format]] | [[Category:Template:Text Format]] | ||
[[Category:Administration]] | [[Category:Administration]] | ||
</noinclude> | </noinclude> |
Revision as of 05:16, 19 December 2019
{{{1}}}
Use this template where you want to show a value or parameter.
Example:
{{Variable|MyAttribute}}: some variable.
Result:
MyAttribute: some variable.
You can optionally also specify a type to be shown before the variable.
Example:
{{Variable|MyAttribute|Type}}: some variable.
Result:
TypeMyAttribute: some variable.
You can optionally also specify a second type to be shown after the variable.
{{Variable|MyAttribute|Type|Type2}}: some variable.
Result:
TypeMyAttribute (Type2
): some variable.