Help:Piped link

Revision as of 16:56, 3 June 2006 by Admin (talk | contribs) (Started page)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

A piped link is a link within the project or to a sister project which is labeled differently from the name of the page it links to. 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 other page. With a suitable browser and depending on the preferences set, one can still see what page is linked to: when you point at the link, the name shows up in a hover box and is also shown in the status bar.

For instance:

[[Kari Holma|How a small child was raised from the dead]]

will show: How a small child was raised from the dead

The term piped refers to the use of the pipe character "|" used to separate the good description from the actual link.

Another example would be [[Ephesian Church Age|Ephesus]] rendering as Ephesus. This is useful where the word "Ephesus" is used in an article referring to the Seven Church Ages; from the context, it would be clear that the church age is meant and not the city, Ephesus. The piped link is more convenient to the user than a link to Ephesian Church Age.

Using a redirect as an alternative

An alternative is simply using [[ How a small child was raised from the dead]] to create How a small child was raised from the dead (note that, unlike above, what pops up when you point at the link, if applicable for your browser, is simply the text already shown), and making How a small child was raised from the dead a redirect page.

This is convenient if the redirect is already there or will also be of use elsewhere; however, there are a few drawbacks:

  • the popup does not show the page one will arrive at
  • "Related changes" does gives the changes in the redirect page
  • the redirect message on the new page slightly clutters it

On the other hand, one may prefer the link title to provide some information that is not in the name of the page one links to, such as the value of a unit in terms of other units. In that case one can make a page whose pagename is the info one wants in the link title, and which redirects to a page with a more appropriate name. See e.g. w:Template:Ft, containing [[30.48 cm|ft]], with the page w:30.48 cm redirecting to w:Foot (unit of length).

Automatic conversion of the wikitext (pipe trick)

If in a piped link the part after the "|" is left empty, it is converted to an abbreviated form of the page name on the left, as follows:

  • if there is a colon in it, the leftmost colon and anything to the left of that is removed (this does not work for "MediaWiki User's Guide:" due to the apostrophe)
  • if there is a text in parentheses at the end it will be removed

For example, the wikitext [[Help:Template|]] is converted to [[Help:Template|Template]], rendered as Template.

If there is nothing to abbreviate, i.e. there is no colon and there are no parentheses, then the link does not work at all, e.g. [[a|]].

Just like for the three or four tildes when signing on Talk pages and the use of subst, in a preview, the result already shows up in the preview itself, but the conversion in the edit box is not yet shown. Save and press Edit again to see the result of the conversion.


Examples


*[[project:a (b)|]]
*[[BelieveTheSign:project:a (b)|]]

produces

Syntax for external links

For external links a space is used instead of a pipe character; see Help:Editing. A general term used for both is also clean link.

See also