= – Template

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Fix category sort key)
m (Text replacement - "{{Inline code|" to "{{ic|")
Line 3: Line 3:
Use to transclude the equals symbol into template parameters, where the normal use of the symbol would provoke the parsing of the parameter's text, assigning the text to the right of the symbol as the value of a variable named by the text to the left.
Use to transclude the equals symbol into template parameters, where the normal use of the symbol would provoke the parsing of the parameter's text, assigning the text to the right of the symbol as the value of a variable named by the text to the left.


i.e. {{Inline code|<nowiki>{{Inline code|_foo = true;}}</nowiki>}} would result in a transclusion of {{Template|Inline code}} (and/or other similar templates) with the value {{Inline code|true;}} assigned to a variable called {{Inline code|_foo}} because of the way MediaWiki parses Template code. So we use {{Inline code|<nowiki>{{Inline code|_foo {{=}} true;}}</nowiki>}} in order to stop the equals sign being parsed as an assignation. Thus {{Inline code|<nowiki>{{Inline code|_foo {{=}} true;}}</nowiki>}} results in the desired {{Inline code|_foo {{=}} true;}}.
i.e. {{ic|<nowiki>{{ic|_foo = true;}}</nowiki>}} would result in a transclusion of {{Template|Inline code}} (and/or other similar templates) with the value {{ic|true;}} assigned to a variable called {{ic|_foo}} because of the way MediaWiki parses Template code. So we use {{ic|<nowiki>{{ic|_foo {{=}} true;}}</nowiki>}} in order to stop the equals sign being parsed as an assignation. Thus {{ic|<nowiki>{{ic|_foo {{=}} true;}}</nowiki>}} results in the desired {{ic|_foo {{=}} true;}}.


[[Category:Templates|{{uc:{{PAGENAME}}}}]]
[[Category:Templates|{{uc:{{PAGENAME}}}}]]
</noinclude>
</noinclude>

Revision as of 18:12, 27 February 2021

=

Usage

Use to transclude the equals symbol into template parameters, where the normal use of the symbol would provoke the parsing of the parameter's text, assigning the text to the right of the symbol as the value of a variable named by the text to the left.

i.e. {{ic|_foo = true;}} would result in a transclusion of {{Inline code}} (and/or other similar templates) with the value true; assigned to a variable called _foo because of the way MediaWiki parses Template code. So we use {{ic|_foo {{=}} true;}} in order to stop the equals sign being parsed as an assignation. Thus {{ic|_foo {{=}} true;}} results in the desired _foo = true;.