Template:!/doc

From WSU Technology Knowledge Base
Jump to navigation Jump to search

Lua error in package.lua at line 80: module 'Module:Message box/configuration' not found.

The magic word {{!}} is used to escape a vertical bar character "|" in wikitext markup, causing the parser to temporarily not interpret it as a special character.

This used to use this template, but for speed reasons, the MediaWiki parser was changed in July 2014 to instantly interpret {{!}} as "|" and ignore this template, making {{!}} a magic word. You can continue to use the code in exactly the same way as before.

It is possible but not useful to transclude the template, instead of using the magic word, by using abnormal syntax like {{Template:!}}, or by supplying a parameter, for example {{!|foo}}. This generates an error.

Usage

The code {{!}} is used to escape the vertical bar character, |, so that it is interpreted later than it otherwise would. This is mostly useful when trying to include a table in a template. For example,

{{rquote|none|text=
{| class="wikitable"
|+ Caption text
|-
! Header text !! Header text
|-
| Example || Example
|-
| Example || Example
|}
}}

yields nonsense:


However escaping the bars with this magic word and similar templates gives:

{{rquote|none|<nowiki>
</nowiki>{{{!}} class{{=}}"wikitable"
{{!}}+ Caption text
{{!}}-
! Header text !! Header text
{{!}}-
{{!}} Example {{!!}} Example
{{!}}-
{{!}} Example {{!!}} Example
{{!}}}
}}


See also

Template call
(m for magic word)
Output (delayed interpretation as wikimarkup) HTML alternative (never interpreted as wikimarkup)
Script error: No such module "Template link general". (m) | &#124; or {{pipe}}
Script error: No such module "Template link general". = &#61;
Script error: No such module "Template link general". || &#124;&#124;
Script error: No such module "Template link general". [ &#91;
Script error: No such module "Template link general". ] &#93;
Script error: No such module "Template link general". [[ &#91;&#91;
Script error: No such module "Template link general". ]] &#93;&#93;
Script error: No such module "Template link general". { &#123;
Script error: No such module "Template link general". } &#125;
Script error: No such module "Template link general". {{ &#123;&#123;
Script error: No such module "Template link general". }} &#125;&#125;
Script error: No such module "Template link general". {{{ &#123;&#123;&#123;
Script error: No such module "Template link general". }}} &#125;&#125;&#125;
Script error: No such module "Template link general". &#9474;

Documentation for the magic word may be found in the MediaWiki documentation at mw:Help:Magic words#Other.