Help:Pipe trick
this wiki
Contents
[show]By adding a pipe or vertical bar ("|" -- Shift + Backslash on most keyboards) before the closing brackets in certain links, you can hide:
- namespaces and other prefixes that use commas
- clarifying words in parentheses
- words after commas
This is a variation on the original use of the pipe by which you type the desired display after the pipe.
The pipe trick is helpful for when you want to link to a page from within a sentence without using the full page name. It affects only what is displayed on the page, not where the link goes. After you save the page, the software adds the displayed text to the code.
Since the pipe trick can be hard to follow, it is best illustrated through the following examples:
The types
Edit
Namespace or other prefix that precedes a colon
Edit
Everything up to the (first) colon is hidden:
-
[[Project:Something|]]is converted to[[Project:Something|Something]]. -
[[w:Category:Something|]]is converted to[[w:Category:Something|Category:Something]].
For example:
- User:Example would be converted to Example.
- w:Category:Policy would be converted to Category:Policy.
Bracket and what follows
Edit
-
[[Someone (author)|]]is converted to[[Someone (author)|Someone]]. -
[[Someone (clown)|]]is converted to[[Someone (clown)|Someone]].
Comma and what follows
Edit
-
[[Some City, Some State|]]is converted to[[Some City, Some State|Some City]].
Combinations
Edit
A prefix will be hidden in addition to a comma or bracket expression.
Parentheses take precedence over commas: where a link has a comma (or more than one) and a final parenthesis, only the parenthesis disappears:
- [[Category:Yours, Mine and Ours (1968 film)|]] becomes [[Yours, Mine and Ours (1968 film)|Yours, Mine and Ours]]
Notes
Edit
- The pipe trick does not work for external links; the equivalent code, a space, must have the desired display typed or pasted after it.
- It does not work in: section links; edit summaries; references defined by "ref" tags.
- Pipes work differently with categories, defining the listing order.
See also
Edit
- Help:Links
- Help:Pipe trick on Wikipedia
Further help and feedback
Edit
- Browse and search other help pages at Help:Contents
- Check Help:Wikia Community Central for sources of further help and support
- Check Help:Contacting Wikia for how to report any errors or unclear steps in this article