GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing en.wikipedia.org — Help:Link - Wikipedia (Redirected from Help:Piped link)
"H:L" redirects here. For help with lists, see Help:List.
This page is about how to mark up links. For a very basic tutorial, see Wikipedia:Tutorial/Wikipedia links. For various URLs of Wikipedia and other Wikimedia servers, see Help:URL.
This page explains how to make links to pages on Wikipedia (wikilinks), to other Wikimedia projects (interwiki links), and to other websites (external links). It also explains how to make anchors within Wikipedia pages. For guidelines on how to use links, see Wikipedia:Manual of Style/Linking. Wikilinks (internal links)See also: Wikipedia:Manual of Style/Linking and Help:Wikitext § Wikilinks
For the syntax to insert pictures and other media files, see Wikipedia:Extended image syntax.
A "wikilink" is our common name for an internal link, that is, a link from one page to another page within the same Wikipedia (for example, within the French Wikipedia) or within the same Wikimedia project (for example, within Wiktionary). Basic syntaxA wikilink is enclosed in double square brackets. On any Wikimedia page, Section linkingTo link to a section in another page, append a hash mark, pound or number sign (
Note the use of piping, done to hide the # character. This is appropriate in Wikipedia articles. Alternatively, format such section links with the section sign (§) instead of a # by using the {{Section link}} template (alias {{slink}}):
Note: you cannot use the § directly. That is, use section link or Page name § Section name rather than Page name#Section name. A third option is to use a redirect (link to a page which link directly to a section, see MOS:SECTLINK). Outside of article space, such as in talk page discussions, using the raw # syntax is fine. Wikipedia inherits this syntax from HTML. These section links work the same regardless of nesting, i.e. whether you link to a section header, a subsection header or a sub-subsection header (sections nestled inside other sections):
Note that this means that each header title must be unique across the entire page (or your browser will simply link to the first one encountered). You do not and cannot indicate "a section within a section" — To link to a section on the page you're already on, you may omit the page name:
Omitting the page name is recommended when linking to a section in the same page because the link will work as expected when previewing changes or after moving the page. It also makes it clear you intend a same-page link. Note that section names are entirely case sensitive, in contrast to article links, where the first letter is not case sensitive. The characters For more information, see Help:Section. See also Wikipedia:Redirect § Targeted and untargeted redirects. Alternate display textSee also: Help:Piped link
Use a vertical bar
Display text agglutinationLetters and other non-punctuation characters immediately following the closing bracket of a wikilink — with no whitespace in between — get appended to the link display text. The target is unchanged. This syntax provides a shorthand to link to an article by its canonical title while displaying inflected link text that grammatically agrees with the inline text:
Illustrative examples of display text agglutination
Target pageWhen a wikilink is opened, Wikipedia tries to resolve the Wikilink target title to its canonical target page. See § Conversion to canonical form When resolving the target page, the target title is treated as case-sensitive except for the first character:
DisambiguationWhen an edit is previewed before saving, if the target of a newly made link turns out to be a disambiguation page, such as the Peacemaker page, the link should be changed to one of the choices on that page unless the link is purposely in a hatnote. If necessary, the new link can be piped, such as in Readers should not be directed to disambiguation pages unless there is no other option but to do so. Nonexistent page (red link)See also: Wikipedia:Red link and Help:What links here
If the target page of a wikilink does not exist, it is displayed in red font and is called a "red link": This link is an example of a red link On hover over the red link, a tool tip provides more information about the red link. If a red link is opened, the user is taken to a blank page where it is possible to create a page using that red-linked title. While on that blank page, other red links to this (non-existent) title can be detected using the "What links here" feature. Self linkA self link is a wikilink with a target page identical to the page on which it appears. Instead of producing an actual link, self links behave like regular body text, with no action upon interaction,[2] and are rendered as bolded body text: :root .mw-selflink { text-decoration: none; } Bolded self-links are usually undesirable, except within navigation templates, where the self-link-produced boldface helps locate the article within the template. In some cases, such as with templates that are not navigation templates, and that are transcluded into several pages, self-links can be actively suppressed by enclosing the link within the template {{No self link}}. A link to a section of the same article, even from the same section, does not produce bold text and works as a normal link. For example, A self-link is indirect if it links to a page that redirects back. In this case, the page name is technically different, so the link is not bolded: Special wikilinksSome types of wikilink target pages result in special behavior:
When targeting these page types, the special behavior can be suppressed to display a regular wikilink by prepending a colon character
Uncommon link target interpretationsLess common ways in which link targets are reinterpreted are described below in #Conversion to canonical form. Editing toolsWhen editing source, links are inserted or deleted simply by adding or removing pairs of square brackets enclosing the text concerned (plus handling piped links). There are some helpful tools:
Special pagesA wikilink cannot add a URL query string like
There are other such special pages like Special:PageHistory and Special:EditPage but the above are some of the most useful, e.g. in edit summaries where a URL doesn't produce a clickable link. Interwiki linksSee also: Help:Interwiki linking and Help:Interlanguage links
An interwiki link links to a page on another Wikimedia project website, such as Meta or another language Wikipedia. The target site must be on the interwiki map specified for the source wiki. These links have the same For example, Interwiki links can be piped, just as with wikilinks. Remember that an interlanguage link should be preceded by a colon if it is to be displayed, where it is inserted in the text, as an inline interlanguage link; otherwise it will be displayed in the list of interlanguage links at the side of the page (which is appropriate only if it is the most closely corresponding page in the other language Wikipedia). Thus (incorporating the pipe trick), Interwiki links (like external links) are displayed in a slightly paler blue than ordinary wikilinks. The MediaWiki page formatting does not detect whether these target pages exist, so they are never displayed in red. External linksFurther information: Wikipedia:External links
External links use URLs to link directly to any web page. External links are enclosed in single square brackets (rather than double brackets as with internal links), with the optional link text separated from the URL by a space (not a "|" as with internal links). When rendered, external links are followed by an external link icon. For example, [http://www.example.org/ link text]will be rendered as The URL must be specified in full, including the protocol: for example When no link text is specified, external links appear numbered: For more detailed information on external linking practices, see Help:URL § Linking to URLs. Also note that Special:LinkSearch can be used to find all pages linking to a given site. The external link syntax can also be used to link to particular pages within Wikipedia that are not accessible by wikilinks, such as page history, the edit view, an old version of a page, the diff between two versions, etc. It can also be used to create a navigational image. To display an external link without the arrow icon, place the external link syntax between http: and https:In mid-2015, Wikipedia and all other Wikimedia sites were changed to use HTTPS to encrypt all traffic. Accessing a URL like In the past, when Wikipedia could be accessed via either HTTP or HTTPS, a protocol-relative URL could be used to make an external link (or external-style link to an internal page) which would use AnchorsWhat is an "anchor"?A link from an origin page points to either a whole target page or to a particular spot on a target page. An "anchor" is the computer code that marks a destination spot on a target page. A link to an anchor is sometimes referred to as an "anchor link". Wikipedia automatically creates an anchor for each section and subsection heading. As discussed below, editors may also create anchors anywhere on a target page using HTML code or the {{Anchor}} and {{Visible anchor}} templates. Renaming a section or subsection changes its automatic anchor, leaving no target for pre-existing anchor links that use the old name. To preserve the old target, editors often create an anchor using the old heading name. Section anchorsA link to a section title (as in the examples above) points to an HTML anchor that Wikipedia automatically generates on the target page. Editors can create anchors on smaller units of text using the {{Anchor}} template or the HTML code Editors create anchors to
Links to anchors can also be added to external URLs and to interwiki links, again using the Section links still work through page names that are redirects. For example, if Danzig redirects to Gdańsk, then Danzig#History will link to the "History" section of the article Gdańsk. It is also possible for the target of a redirect to be defined as a specific section or anchor of a page (these work only if JavaScript is enabled). Indeed, according to the Manual of Style, it may be preferable to define such redirects, and use them when linking to those sections/anchors, rather than linking using the For example, Wikipedia:Section link redirects specifically to the section Help:Link#Anchors on this page. A quirk of the way this works is that if one were to add a section name when using such a link, it would override the section specified by the redirect. So Wikipedia:Section link#Interwiki links would go to the "Interwiki links" section of this page. Such overriding of section redirects should be avoided. The {{Visible anchor}} template can be used to create an anchor that is highlighted when it is linked to (click here for an example). The template's first parameter will be used as both the anchor and the display text ( AccessibilityIf the target of the anchor is a section, the anchor should always be placed inside the section header to the left of the section header text. If the {{Anchor}} template is used, it should always be substituted. Not doing so violates Wikipedia:Redirect § Redirects to a section and Wikipedia:Manual of Style §§ Anchors and Wikimarkup and causes technical complications and accessibility issues. See this documentation page for more information. Duplicate section namesIf more than one section on a target page has the same title, a link to the title goes to the first section with that title. If the link should be to another section with the title, or a title that differs only in capitalization (Example vs. EXAMPLE), append to the linked title _2, _3, and so on, without a space (or 2, 3, and so on with a space), counting from the top of the target page and without regard to whether a section is a top-level section or a subsection. For example, multiple sections titled "History" may be linked to as "History", "History_2" (or "History 2"), and so on. Linking to part of a sectionSee also: Help:Link § Table row linking
Anchors can also be used to link to any part of a section. For example, if you want to link to the fifth sentence of a section, you place an anchor at the start of that sentence, and you can then link to that anchor in the same way as you would link to any other anchor. However, just as with section names, duplicate anchor names only link to the first one. Since anchors aren't displayed, you have a much greater freedom in picking unique anchors, such as by appending the current date and time to the anchor name (for example, by naming an anchor for section "ThisSection" like so: Anchors can be placed anywhere, including at the start of a clause, and inside notes and citations, though it is advisable to test first in your sandbox before trying some exotic new kind of location for the first time. Also the anchor has to be placed after any indicators that are only recognized at the start of a line (such as There are a small number of special anchor names. See § Table row linking. Table row linkingTo create an anchor for a row of a table, see Help:Tables and locations § Section link or map link to a row anchor. However, Piped linkSee also: Wikipedia:Piped link
A piped link is an internal link or 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:
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 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:
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 " There are various tricks to get the same result with less typing:
Using a redirect as an alternativeAn alternative to a piped link is using a redirect page. For example, it is unnecessary to say Pipe trickMain page: Wikipedia:Piped link § Pipe trick
The pipe trick uses the pipe character ("
The pipe trick does not work in edit summaries, within
. ^ 1
[[Roger Taylor (author)|]]
ExamplesArticle titles: Pages in other namespaces:
As with all links, it is also possible to blend a suffix when using the pipe trick: Subpage linksA wikilink needs a [[fullpagename]], and this is not optional except when it links to or from a subpage. A wikilink to its parent page is [[../]], and, although no page name is given, the fullpagename is rendered. On the parent a wikilink to a subpage can use [[/subpagename]] to render a subpagename instead. Although subpages are created in the article space, subpage linking does not fully function there. Subpage linking works as expected to link to any pages under a root parent page:
Consider that there are about 140 subpages of the Manual of style arranged in 97 branches, 35 of which have two subpages, and 5 of which have three subpages. Subpage links save typing. Say you're editing this closely related group of fullpagenames:
To see this page's array of subpage variables and markup four levels deep, see /one/two/three/four, and from there go to level two at one/two. Markup [[../]] addresses the basepagename, except when a pagename includes a / slash character (allowed), the basepagename/subpagename variables' characters are skewed. To see all this, and how adding an extra ../ construct fixes the resulting redlink, see /sub/page/name1/sub/page/name2/subpage level 3, and from there go to sub/page/name2. Note that the top of every subpage shows the navigation links to all parent subpagenames. From these you can easily gauge levels and linking constructs. For more information:
Special pages linksTo create a link to a special page:
Because the ampersand character (&) is disallowed, it is not possible to create an ordinary link containing For example, you can use a template such as {{Plain link}} to encode a Wikimedia URL link, such as one pointing to a special page with parameters. {{Plain link|url=https://en.wikipedia.org/w/index.php?title=Special:Log&logid=79269392|name=15:21, 8 December 2016}}gives Changing link appearanceThe ways that various links are displayed in browsers, as described above, are the default display styles in the default skin. Users can change the way they see links:
Hatnote linksA hatnote is a note that sits on top of a paragraph like a hat. Such as the one below. Main page: Wikipedia:Hatnote
Sometimes, an article might have a section in which it explains a concept that already has its own dedicated article. In this case, you could add a 'Main page' link, as is done here. This can be established by using the {{Main}} template. In the visual editor, such a template can be created using Insert > Template > Main, and then setting the 'Page 1' parameter equal to the page to be referred to. The 'Label 1' parameter may optionally be used to set the text the link is displayed as. Up to five of these links may be specified. In the source editor, the code Hover tooltipsIn many browsers, holding the cursor over a link (mouseover) shows a hover tooltip containing the text of the link's HTML For these effects a piped link is useful even if it is not followed; for example, for displaying the meaning of an acronym. It is possible to produce a hover tooltip without a link, using the {{Tooltip}} template. Disallowed charactersA link whose target contains disallowed characters (see WP:Page name) will be displayed without markup, as in Conversions are automatically made to non-literal characters in wiki and interwiki links. For example, Some characters in a web address link need to be represented as escape characters because they are reserved for Wikipedia edits. Examples include In excessive cases, an automatic percent encoder such as the one at W3 Schools (use the second JavaScript form under "URL Encoding Functions") is probably the simplest solution. For example, pasting
Links containing ampersandsBecause the ampersand character (&) is disallowed, it is not possible to create an ordinary link containing
Link reportsFurther information: Help:What links here
The navigable links to a page are wikilinks, redirects, and external-styled wikilinks. The {{orphan}} tag can be placed on pages with no incoming wikilinks. To a pageEach link to a page is a link to a name.[5] No one report shows all links to the content. The What links here tool, on every page, will report all wikilinks and all redirects to the content of that page. (You get the wikilinks to the redirects too.) The search parameter linksto will find wikilinks only. Both report (invisible) wikilinks placed by a transclusion through a {{template}}. The difference between them is that linksto reports a count of links to a page name, while WhatLinksHere reports a map of links to the page as content.[6] To a sectionThe navigable links to a section of a page are wikilinks, redirects, and URL-styled wikilinks.
The difference between a redirect and a wikilink is most pronounced where a redirect targets a section,
when you cannot add your own #section to it
even though it appears as To find wikilinks to a section requires two or more reports.
The more redirects there are, the more reports there are to run. If there are no redirects involved, one report from "Links to" is enough. From a pageTo report links from a page, you simply list all the wikilinks on that page.
One way to send a query to the API is by creating an external link (§ External links). For example, using an external link very much like a search link, you can send the API a request to list the link properties of "wp:example". It should interpret it correctly as "Wikipedia:Example", pageid 25263910.
To make a page register as a link to a page, but without actually showing the link, link to it, but label it with a space character using the pipe trick: [[pagename| ]]. Additional link-related functionsFor the effect that links have on date formatting, see Help:Date formatting and linking. Another link-dependent feature is related changes, which makes it possible to view recent changes to all pages that are linked from the current page (or which are members of the category, if it is a category page). For information on how to link to pages from an image, see mw:Extension:ImageMap. Several templates have been created to make linking easier (although they are not usually used in article space). These include {{tl}} and {{tlx}} for linking to templates, and {{cl}} and {{lc}} for linking to categories. More can be found in Category:Internal link templates. Conversion to canonical formFurther information: mw:Manual:Title.php § Canonical forms
As described previously, if a link target begins with a lower-case letter, it will be interpreted as if it began with the equivalent capital letter. If the target contains a namespace prefix, then the whole prefix and the first character after the colon are case-insensitive (so uSeR:jimbo Wales links to User:Jimbo Wales). In link targets, spaces and underscores (which are effectively equivalent) are ignored if they come at the start, at the end, or immediately before or after the colon following a namespace prefix. Consecutive spaces/underscores are treated as a single space. Hence _User_: Jimbo_ __ Wales__ links to User:Jimbo Wales. HTML character references and percent-encoded characters are replaced with their raw character. For example, Titles indicated by wikilinks are displayed in canonical form (with correction of capitalization and excess spaces/underscores removed, as described previously) in the following places:
The prefixes in interwiki links are treated similarly to namespace prefixes: they are insensitive to case and to spaces before and after the colon. However the first character after the colon is not automatically capitalized (whether it is interpreted as a capital depends on the configuration of the target wiki). See also
Notes
| |||||||||||||||||||||||||||||||||||||||||||||||||
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |