Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Help:Link
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== Piped link == {{See also|Help:Pipe trick}}{{Shortcut|H:PIPE}} A '''piped link''' is an internal link or [[Help:Interwiki linking|interwiki link]] where the link target and link label are both specified. This is needed in the case that they are not equal, while also the link label is not equal to the link target with the last word extended: * <code>'''<nowiki>[[cheese]]</nowiki>'''</code> ''(label = target, no pipe needed)'' *: produces [[cheese]], linked to the article '''Cheese'''. * <code>'''<nowiki>[[cheese]]s</nowiki>'''</code> ''(label = target + extension ["s"], no pipe needed)'' *: produces [[cheese]]s, linked to the article '''Cheese'''. * <code>'''<nowiki>[[blue cheese|cheese]]</nowiki>'''</code> ''(label = part of target, pipe required)'' *: produces [[blue cheese|cheese]], linked to the article '''Blue cheese'''. * <code>'''<nowiki>[[cheese|blue cheese]]</nowiki>'''</code> ''(label = target + additional text ["blue"], pipe required)'' *: produces [[cheese|blue cheese]], linked to the article '''Cheese'''. * <code>'''<nowiki>[[cheese|that stuff]]</nowiki>'''</code> ''(label is completely different from target, pipe required)'' *: produces [[cheese|that stuff]], linked to the article '''Cheese'''. This allows linking a word or phrase within the text of a page rather than using "see also", even if the wording does not exactly correspond with the name of the target page. With a suitable browser and depending on the [[Help:Preferences|preferences]] set, one can still see the link target: when you point at the link, the name shows up in a hover tooltip and is also shown in the status bar. For instance: <code><nowiki>[[Train station|station]]</nowiki></code><br /> will show: [[train station|station]] This is useful where the word "station" is used in an article on trains; from the context, it would be clear that a train station is meant. The piped link is more convenient to the user than a link to [[station]] which might be a disambiguation page. The word ''piped'' refers to the use of the pipe character "|" used to separate the good description from the actual link. This character is named after another use of it; see [[Pipe (computing)]]. There are various tricks to get the same result with less typing: * Leave the part to the right empty β the "[[#Automatic conversion of wikitext with the pipe trick|pipe trick]]" * Leave the part to the left empty β the "{{pslink|inverse pipe trick}}" * Just attach text to the link, as in "<nowiki>[[train]]s</nowiki>", see [[MOS:PIPE]]. === Using a redirect as alternative === An alternative to a piped link is using [[Help:Redirect|redirect pages]]. For example, to create [[How to set up a coffee house]], use <code><nowiki>[[How to set up a coffee house]]</nowiki></code> and make this a redirect to [[coffeehouse setup]]. This is convenient if the redirect is already there or will also be of use elsewhere; however, there are a few drawbacks: * The tooltip does not show the page one will arrive at. * "[[Help:Related changes|Related changes]]" gives the changes in the ''redirect page'', not the redirect target. Combining a piped link and a redirect, one can provide some information that is not the name of the page one links to in the hover tooltip, e.g., the pipe to a redirect <code><nowiki>[[United Nations Organization|UNO]]</nowiki></code> will display a tooltip "United Nations Organization" when hovering over [[United Nations Organization|UNO]], thereby explaining the abbreviation. (However, {{tl|abbr}} is preferred for abbreviations.) === Automatic conversion of wikitext with the pipe trick === {{See also|Help:Pipe trick}} If in a piped link the part after the "|" is left empty, it is [[Help:Automatic conversion of wikitext|converted]] to an abbreviated form of the linked page, as follows: # Any word before the first colon (:), as well as the colon itself, is removed. This word may or may not be a namespace prefix (such as "Help:") or an interwiki prefix (such as "commons:"). If the page name is preceded by a colon, "first" refers to "first after this". # If there is text in parentheses at the end it will be removed. # If there are no parentheses but there is a comma, the comma and everything after it are removed. # The link will be in whatever case is used. Just like for the three or four tildes when signing on Talk pages and the use of <code>subst</code>, in a preview, the result already shows up in the preview itself, but the conversion in the edit box is not yet shown. Press "Show changes" to see the change in the wikitext. ;Category tag :The sort key syntax of the category being like a piped link, the pipe trick also works for category tags, even though it is not useful there. ;Examples using colons : <code><nowiki>[[Help:Template|]]</nowiki></code> is converted to <nowiki>[[Help:Template|Template]]</nowiki>, which is rendered as [[Help:Template|Template]]. : <code><nowiki>[[Music: My life|]]</nowiki></code> is converted to <nowiki>[[Music: My life| My life]]</nowiki>, which is rendered as [[Music: My life| My life]] β although "Music:" is not a namespace (therefore the space after the colon is not automatically removed), the shortcut works anyway. : <code><nowiki>[[w:en:Pipe (computing)|]]</nowiki></code> is converted to <nowiki>[[w:en:Pipe (computing)|en:Pipe]]</nowiki>, which is rendered as [[w:en:Pipe (computing)|en:Pipe]]. ;Case examples : <code><nowiki>[[pipe (computing)|]]</nowiki></code> is converted to <nowiki>[[pipe (computing)|pipe]]</nowiki> which is rendered as [[pipe (computing)|pipe]]. : <code><nowiki>[[Pipe (computing)|]]</nowiki></code> is converted to <nowiki>[[Pipe (computing)|Pipe]]</nowiki> which is rendered as [[Pipe (computing)|Pipe]]. ;Comma example : <code><nowiki>[[commons:Boston, Massachusetts|]]</nowiki></code> is converted to <nowiki>[[commons:Boston, Massachusetts|Boston]]</nowiki>, which is rendered as [[commons:Boston, Massachusetts|Boston]]. ;Other examples :[[Help:Templates#Parameters|Parameters]] and [[Help:magic words#Variables|variables]]: :<code><nowiki>[[w:{{{1}}}|]]</nowiki></code> does ''not'' give <nowiki>[[w:{{{1}}}|{{{1}}}]]</nowiki>. : Calling the template with a value of parameter 1 gives a working link in the case of substitution only. :<code><nowiki>[[w:en:{{FULLPAGENAME}}|]]</nowiki></code> does ''not'' give <nowiki>[[w:en:{{FULLPAGENAME}}|en:{{FULLPAGENAME}}]]</nowiki>. : <code><nowiki>[[m:{{FULLPAGENAME}}|]]</nowiki></code> does ''not'' give <nowiki>[[m:{{FULLPAGENAME}}|{{FULLPAGENAME}}]]</nowiki> <syntaxhighlight lang="wikitext"> * [[project:a (b)|]] * [[w:project:a (b)|]] * [[:de:project:a (b)|]] * [[wiktionary:project:a (b)|]] * [[wiktionary:de:project:a (b)|]] * [[wikibooks:project:a (b)|]] * [[wikiquote:project:a (b)|]] * [[wikisource:project:a (b)|]] * [[w:en:{{FULLPAGENAME}}|]] ** [[w:en:{{FULLPAGENAME}}|en:{{FULLPAGENAME}}]] * [[m:{{FULLPAGENAME}}|]] ** [[m:{{FULLPAGENAME}}|{{FULLPAGENAME}}]] </syntaxhighlight> These examples appear as: * [[project:a (b)|a]] * [[w:project:a (b)|project:a]] * [[:de:project:a (b)|project:a]] * [[wiktionary:project:a (b)|project:a]] * [[wiktionary:de:project:a (b)|de:project:a]] * [[wikibooks:project:a (b)|project:a]] * [[wikiquote:project:a (b)|project:a]] * [[wikisource:project:a (b)|project:a]] * [[w:en:{{FULLPAGENAME}}|]] ** [[w:en:{{FULLPAGENAME}}|en:{{FULLPAGENAME}}]] * [[m:{{FULLPAGENAME}}|]] ** [[m:{{FULLPAGENAME}}|{{FULLPAGENAME}}]] === Inverse pipe trick === On page "A (c)", <code><nowiki>[[|B]]</nowiki></code> is automatically converted to <nowiki>[[B (c)|B]]</nowiki>. Similarly, on page "A, c", <code><nowiki>[[|B]]</nowiki></code> is automatically converted to <nowiki>[[B, c|B]]</nowiki>. [[Help:Pipe_trick#Reverse_pipe_trick|Further examples are here.]]
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)