The '''pipe trick''' is a way (or really several ways) to create links without having to type a lot of extra text. The advantage is that you are less likely to make a mistake when you type less. It's also easier for others to edit it. To create the [[pipe character]] ("|") press (SHIFT + BACKSLASH ["\"]) on English-layout and some other keyboards.
When you place a [[Vertical bar|pipe character]] ("'''|'''") after an [[Wikipedia:What is an article?|article]] title which ends with a [[Bracket#Parentheses ( )|parenthesized]] term or contains a [[comma (punctuation)|comma]] or [[Colon (punctuation)|colon]], the [[wiki software]] transforms what you entered. The non-parenthesized part of the article title is used as the visible part of the link. This does not work in edit summaries, and in certain other cases (listed below).
==Examples==
This may be hard to follow, so please see the examples:
{| class="wikitable"
|-
!| Type this
!| Generates this when you "Save page"
!| Appears as
|-
! colspan="3" style="text-align: left;" | Article titles
|-
|| [[g (factor)|]]
|| [[g (factor)|g]]
|| [[g (factor)|g]]
|-
|| [[Boston, Massachusetts|]]
|| [[Boston, Massachusetts|Boston]]
|| [[Boston, Massachusetts|Boston]]
|-
|| [[The Lord of the Rings: The Fellowship of the Ring (video game)|]]
|| [[The Lord of the Rings: The Fellowship of the Ring (video game)|The Fellowship of the Ring]]
|| [[The Lord of the Rings: The Fellowship of the Ring (video game)|The Fellowship of the Ring]]
|-
! colspan="3" style="text-align: left;" | Redirection
|-
|| [[Bush (43)|]]
|| [[Bush (43)|Bush]]
|| [[Bush (43)|Bush]]
|-
|| [[Bush (41)|]]
|| [[Bush (41)|Bush]]
|| [[Bush (41)|Bush]]
|-
! colspan="3" style="text-align: left;" | Normal titles
|-
|| [[Wikipedia:Help|]]
|| [[Wikipedia:Help|Help]]
|| [[Wikipedia:Help|Help]]
|-
! colspan="3" style="text-align: left;" | Users
|-
|| [[User:Example|]]
|| [[User:Example|Example]]
|| [[User:Example|Example]]
|-
|}
==Where it does not work==
===Cite.php <ref> footnotes===
The trick does not work when enclosing between [[wikipedia:footnotes|"ref" tags]]. [[[Roger Taylor (author)|]]]
[[[Roger Taylor (author)|]]] renders in the references list (generated by the tag) as:
===Edit summaries===
The trick does not work in edit summaries. /* Edit summaries and the pipe trick */ as tested in [[WP:SAND|]]
renders in the edit history as:
== Slash trick ==
You can achieve the same effect for subpages by adding a slash: [[/subpage/]]
generates the same output as [[/subpage|subpage]]
. Unlike the pipe trick, though, it will not be transformed in the [[wikitext]].
This trick only works in namespaces where [[/subpage]]
would.
== Reverse pipe trick ==
Typing [[|Agonizer]] on, for example, [[Agonist (disambiguation)]] will cause the link to be expanded to [[[[Agonizer (disambiguation)]]|Agonizer]]; similarly on a page with a name containing a comma. Using the reverse pipe trick on a page that has no parentheses or comma in its name is unproductive; the pipe character is automatically removed.
==Try it!==
The best way to understand this is to try it yourself in the [[Wikipedia:Sandbox|sandbox]]. Use one of the examples under "Type this" above, save the page, then immediately edit it again. You'll see the transformation, and it should be clearer exactly what happened.
==See also==
* [[Help:Magic]]
* [[Help:Piped link]]
* [[m:Help:Piped link]]
[[Category:Wikipedia features|{{PAGENAME}}]]