Template:!/doc
Documentation
This provides a "pipe" character (|) for use in contexts where it would otherwise be interpreted as part of wiki markup syntax (e.g., in wikilinks, tables, and templates).
The template is actually not called if {{!}} is used, because that exact string is handled "natively" by MediaWiki. (This is why there are so few pages that show up as using this template, even though {{!}} is being used in hundreds of pages of template documentation on this wiki.)
However, there are ways of forcing a call to the template (as seen in the examples below), and in those cases any input to the template is ignored.
The only thing the template does, in fact, is output (the value of) {{!}}, so really the only reason this template page exists is to document the use of the built-in feature.
Note: If you need two "pipes" in a row (||), it's more efficient (in terms of typing) to use {{!!}} rather than {{!}}{{!}}.
Usage
{{!}}
Examples
{{!}}⇒ |{{!|}}⇒ |{{Template:!}}⇒ |
The first example uses the built-in feature; the second and third actually call this template. (In the second example, empty input is being passed to the template in the first unnamed/positional parameter). All three examples are totally equivalent in terms of their effects, except the first is a bit more efficient than the other two.
Here's a more useful example:
{{tc|foo{{!}}}}⇒{{foo|}}
This shows the markup that would call a template with an empty first positional parameter (which is how the second example above was actually accomplished). The {{!}} is necessary here because the following doesn't do the right thing:
{{tc|foo|}}⇒{{foo}}