From Gentoo Wiki
Jump to: navigation, search

There are four kinds of links in MediaWiki:

  1. internal links to other pages in the same wiki
  2. external links to other websites
  3. interwiki links to other websites specifically registered as possible link targets
  4. interlanguage links to other websites registered as other language versions of the same wiki

This wiki does not use the fourth type of link, since we handle multiple languages differently.

Internal links

An internal link (from a "source" page to a "target" page on the same wiki) is formed by enclosing the name of the desired target page in [[double square brackets]]. If it is awkward to use the actual page title at that point in the source page text, a piped link can be used (see examples below).

When the source page is previewed or saved, the new link will be visible. If the target page already exists on this wiki, it will appear blue (or purple, if the page has already been visited by the reader); if not, it will appear red. (Following a "redlink" will bring up the page editor in which the page can be created. For more information about editing and creating pages, please see our other Help pages.)

Note that "selflinks", in which the source and target pages are the same, are not shown as links but instead displayed in bold. If you want to link to a particular place (i.e., a section heading) in the current page, use an "anchor" (see below), or use [[#top|current page]], which always links to the top of the page.

Note that the first letter of the target page is case-insensitive (it is automatically capitalized in page titles but can be upper- or lower-case in links), and that spaces can be represented as underscores (typing an underscore in a link is equivalent to typing a space, but is not recommended, except possibly in piped links, since the underscore will be visible to the reader).

Description You type You get
Internal link
[[Main Page]]

Main Page

Piped link
[[Main Page|different text]]
[[Main_Page|different text]]

See also Help:Piped link on

different text

different text

Internal link to pagename with leading slash


Hide namespace shortcut

Short for [[Help:Contents|Contents]] (expanded in page source when saved).


Word-ending links




Avoiding word-ending links
[[Help]]<nowiki />ful advice
[[Wikipedia:GNU General Public License|GPL]]<nowiki />v3

Helpful advice


Page title redirect
#REDIRECT [[Main Page]]

See Help:Redirects.

Main Page

Internal link to an anchor
[[#See also]]

Section headings and the [[#top]] of the page are automatically anchored.

#See also

Piped internal link to anchor
[[#See also|different text]]

different text

Setting internal link anchor target
<div id="UniqueAnchorName">optional text</div>
<span id="AnotherUniqueAnchorName">optional text</span>

Allows [[Help:Links#UniqueAnchorName]]; omit "optional text" for an invisible anchor.

optional text

optional text

Internal link to anchor in another page
[[Help:Images#See also]]

Help:Images#See also

Internal link to current page's talk page

See also Help:Magic words.


Internal link to subpage of current page

Shorter version of [[Help:Links/example]] when used on the page Help:Links. See also Help:Subpages.


Internal link to subpage hiding leading slash

Shorter version of [[Help:Links/example|example]] when used on the page Help:Links.


Internal link to category page

Note that the leading colon is required; see Help:Categories.


Internal link to image or file of other type

See also Help:Images.



Internal link to the reader's user page


Internal link to translated article

Target as per Language settings in preferences (otherwise target would be in English).


External links

An external link (to a "target" page on another website) is formed by enclosing the URL of the desired target page in [single square brackets]. If no other text is specified, the link is shown as a bracketed number; however, this is discouraged in favor of the equivalent of a piped link, which in this case is accomplished by simply separating the normal "link text" from the URL with a space (see examples below).

When the source page is previewed or saved, the new link will be visible followed by a small icon to indicate that the reader will leave the current wiki if they follow the link. Unlike with internal links, an external link will look the same whether or not the target page actually exists.

If the target website can be browsed in secure HTTP, it is preferable to omit the "https:" portion of the URL.

Description You type You get
Bare external link

Requires "http:" or "https:".

Avoiding link on bare URL

Protocol-relative URL
[// MediaWiki]

Uses secure HTTP if current page is using it.


External link with different text
[// MediaWiki]


Numbered external link

Autonumbered sequentially on each page.


External links with file icons
[// video]
[// sound]
[// document]

See External link icons below for currently supported file extensions and their icons.




External link to same host

See also next section; this and the next example use the bare-URL form merely for clarity.

Passing the current pagename in an external link{{PAGENAMEE}}{{FULLPAGENAMEE}}

Note the final E, which indicates the URL-encoded page title.

Mailto link
[ email me]

email me

Mailto with subject line and body
[ label]

Subject and body must be URL-encoded; might not work for everyone.


External links to internal pages

Linking to a wiki page whose URL contains parameters (set off by ? and &) is most easily accomplished using an external link.

Description You type You get
Providing external link to edit a page
[// Edit]


Same using a parser function to refer to the current page
[{{fullurl:{{FULLPAGENAMEE}}|action=edit}} Edit]

See also the help on page-name variables and parser functions.


Same styled to look like internal link
<span class="plainlinks">[{{fullurl:{{FULLPAGENAME}}|action=edit}} Edit]</span>

See Manual:Plainlinks at the MediaWiki wiki.


Linking to a specific page edit
[// diff]

See also Help:Tracking changes.


External link icons

If the link uses a special protocol or its target is a special kind of file (based on the file extension in the URL), it may be marked with a special icon (instead of the default showing an arrow).

Test link Icon Trigger
[2] external-link-ltr-icon.png .external, http://, gopher://
[3] lock-icon.png https://
[4] mail-icon.png mailto:
[5] news-icon.png news://
[6] file-icon.png ftp://
[7] talk-icon.png irc://
[8] audio-icon.png .ogg, .mid, .midi, .mp3, .wav, .wma
[9] video-icon.png .ogm, .ogv, .avi, .mpeg, .mpg
[10] document-icon.png .pdf, .pdf#, .pdf?

Interwiki links

Interwiki links are internal-style links to external websites that have been registered in advance as useful targets for outgoing links. The most well known such site is the English Wikipedia.

Unlike other internal links, interwiki links do not rely on page existence detection, so an interwiki link will look the same whether the target page exists or not.

Description You type You get
Interwiki link to English Wikipedia article
[[wikipedia:Gentoo Linux]]

wikipedia:Gentoo Linux

Interwiki link to Wikipedia article in other language
[[wikipedia:de:Gentoo Linux]]

Uses (mostly) ISO language codes.

wikipedia:de:Gentoo Linux

Same using alternate link text
[[wikipedia:de:Gentoo Linux|German]]

For other variations, see Internal links above.


Interlanguage links

Interlanguage links (in which the target is a page in a different language hosted at an entirely different wiki) are not used on the Gentoo Linux wiki. Instead the Translate extension is used to maintain pages in languages other than English. Please see the Gentoo Wiki:FAQ for more information.


For including a section of pages linking to the present page, use the {{Whatlinkshere}} template. This appears useful within noinclude tags for pages transcluded to others.

What links here:

See also