Template:=: Difference between revisions
en>GKFX (Copy from Template:=/sandbox - now that transclusions are zero, add error message to any transclusions.) |
No edit summary |
||
(One intermediate revision by the same user not shown) | |||
Line 1: | Line 1: | ||
= | |||
<includeonly>{{error|Error: The retired template {{tn|1==}} has been transcluded; see [[mw:Help:Magic words#Other]] for details. To fix this, use only the code {{Magic word|1==}} to generate the = character.}} | <includeonly>{{error|Error: The retired template {{tn|1==}} has been transcluded; see [[mw:Help:Magic words#Other]] for details. To fix this, use only the code {{Magic word|1==}} to generate the = character.}} | ||
[[Category:Pages which use a template in place of a magic word|T]]</includeonly><noinclude>{{Documentation|heading=[[File:Test Template Info-Icon - Version (2).svg|50px|link=|alt=]] Magic word documentation}} | [[Category:Pages which use a template in place of a magic word|T]]</includeonly><noinclude>{{Documentation|heading=[[File:Test Template Info-Icon - Version (2).svg|50px|link=|alt=]] Magic word documentation}} | ||
</noinclude> | </noinclude> |
Latest revision as of 13:20, 24 February 2023
=
This template may have no transclusions, because it was replaced with a magic word. |
This magic word allows "=" to be used in unnamed template parameters, rather than being interpreted as the separator between the parameter name and value. It evaluates to the equals sign, =. Alternatively, the HTML entity "=" can be used if there is no need for it to be interpreted as wikimarkup, such as when the literal equals-sign is to be displayed to the user. Until June 2022, there was a template at this location with the same function, but it was replaced with a magic word for performance reasons in Phab:T91154.
Do not use syntax like {{Template:=}}
, and do not supply a parameter, for example {{=|foo}}
. In those cases, the template transcludes as an error message: Error: The retired template {{=}} has been transcluded; see mw:Help:Magic words#Other for details. To fix this, use only the code {{=}} to generate the = character.
Do not use the magic word in URLs rather use percent-encoding or no encoding:
- Wrong:
https://example.com/?arg{{=}}789
- Correct:
https://example.com/?arg%3D789
- Correct:
https://example.com/?arg=789
Usage
{{Font color|black|yellow|2 + 2 {{=}} 4}}
produces: 2 + 2 =
Error: The retired template {{Template:=}} has been transcluded; see mw:Help:Magic words#Other for details. To fix this, use only the code {{=}} to generate the = character. 4
You can also use named parameters to bypass the restriction:
{{Font color|black|yellow|3= 2 + 2 = 4}}
produces: 2 + 2 = 4
Unlike =
, the magic word only delays the interpretation of the symbol as code:
{{concat|<div style{{=}}"font-style:italic">This should be italicised.</div>}}
{{concat|<div style="font-style:italic">This will not be italicised.</div>}}
produces: <div style=
Error: The retired template {{Template:=}} has been transcluded; see mw:Help:Magic words#Other for details. To fix this, use only the code {{=}} to generate the = character."font-style:italic">This should be italicised.TemplateData
TemplateData for =
A magic word to allow = to be used in template parameters
Parameter | Description | Type | Status | |||
---|---|---|---|---|---|---|
No parameters specified |
See also
Template call <span style= Error: The retired template {{Template:=}} has been transcluded; see mw:Help:Magic words#Other for details. To fix this, use only the code {{=}} to generate the = character."font-weight:normal; font-style:normal">(m for magic word) |
Output <span style=
Error: The retired template {{Template:=}} has been transcluded; see mw:Help:Magic words#Other for details. To fix this, use only the code {{=}} to generate the = character."font-weight:normal; font-style:normal">(delayed interpretation as wikimarkup) |
HTML alternative <span style=
Error: The retired template {{Template:=}} has been transcluded; see mw:Help:Magic words#Other for details. To fix this, use only the code {{=}} to generate the = character."font-weight:normal; font-style:normal">(never interpreted as wikimarkup) |
---|---|---|
{{!}} (m) | | | | or {{pipe}} |
{{=}} (m) | = | = |
{{!!}} | || | || |
{{!(}} | [ | [ |
{{)!}} | ] | ] |
{{!((}} | [[ | [[ |
{{))!}} | ]] | ]] |
{{(}} | { | { |
{{)}} | } | } |
{{((}} | {{ | {{ |
{{))}} | }} | }} |
{{(((}} | {{{ | {{{ |
{{)))}} | }}} | }}} |
{{(!}} | {| | {| |
{{!-}} | |- | |- |
{{!)}} | |} | |} |