Help:Interwiki linking

From MozillaWiki
Jump to: navigation, search

MozillaWiki Handbook
Software help for MozillaWiki — see page histories for older versions.
Handbook Contents | Other help

General

Within each project, interwiki linking to a page of another project is possible with internal link style, with a prefix for the other project ("prefixed internal link style"). For each project, an interwiki map (or "InterMap") is specified, i.e. a list of target projects with their prefixes, e.g. [1]. These target projects need not use MediaWiki and need not even be a wiki.

For a given project the namespace prefixes can not also be used as code for an external project. However, the prefix used for a target project may coincide with the prefix for the project namespace within that project. As a result, to link to a page in that namespace one has to use the same prefix twice, e.g. wikibooks:wikibooks:Manual of Style.

Interlanguage link (software feature)

For a multilingual family of similar projects, with one project per language, a system for interlanguage linking can be set up. If this project is in a family for which this applies, Help:Interlanguage link demo may demonstrate what is explained below (this depends on whether the same language codes are used).

An interwiki link within the family is treated differently unless it is on a talk page of any namespace: it appears at one or two edges of the webpage (in Monobook on the left, in Classic at the top and bottom); to make it inline, prefix a colon.

The link label depends only on the sister project that is linked to, not on the page; it is set in the configuration of the project, typically it is the name of the language in that language. The target is only shown in the hover box and the status bar, depending on the browser.

Therefore this kind of link is mainly suitable for linking to the corresponding page in another language, and not very suitable for multiple links to the same other language. See also Interlanguage use case for a discussion of common troubles with this system and other possible implementations.

The feature can also be used on an image description page, to link to the same or a similar image in a sister project. Other interwiki links to images require the prefixed colon.

Note that a page that might be used as a template, even if it is in an other than the template namespace, is not very suitable to put an interlanguage link in: such a link appears in the edge of the page that includes the template, giving the impression that the link is to a version in the other language of the referring page instead of the template. For the same reason pages in the MediaWiki namespace are not very suitable to put an interlanguage link in.

Interwiki linking from and within Wikimedia

Within Wikimedia, for the purpose of interlanguage links (see above) the project families are Wikipedia, Wiktionary, Wikiquote and Wikibooks. Thus this applies for a link like en:, de:, etc., from a Wikipedia to another one, from a Wiktionary to another one, from a Wikiquote to another one, or from a Wikibooks to another one.

Exceptions

The list of language codes for which this feature applies, including languages which have no Wikipedia, Wiktionary and Wikiquote yet, but for which the feature potentially applies, i.e. applies after the wiki has been created, with local and English name of the language, is Names.php.

The languages that have a Wikipedia and (possibly empty) Wiktionary that are not on the list (commented out) are Klingon (artificial) and Serbocroatian (obsolete). Interwiki links to these always appear in the page body, e.g. tlh:tlhIngan Hol; see also Artificial languages equal rights.

The exceptions apply for linking to those projects, not for linking from them.

Prefixes

The following rules apply:

  • links like this are possible ("Main Page" and "de:" are just examples):
    • en:Main Page, de:Hauptseite, etc. - language version of Wikipedia, unless the link is from a Wiktionary or Wikiquote, then the language version of that set of projects; this works for all existing Wikipedias (list of codes) and Wiktionaries and Wikiquotes (same list, but not for all languages a Wikiquote exists yet)
    • w:Main Page - Wikipedia in the same language as the project the link is from (if that is multilingual, then English)
    • w:de:Hauptseite - German Wikipedia (also from a Wiktionary or Wikiquote) (sometimes this does not work, perhaps this depends on the use of special characters)
    • m:Main Page - Meta
    • wikisource:Main Page - Wikisource
    • commons:Main Page - Wikimedia Commons
    • wikt:Main Page - Wiktionary in the same language as the project the link is from (if that is multilingual, then English)
    • q:Main Page - Wikiquote in the same language as the project the link is from (if that is multilingual, then English)
    • b:Main Page - Wikibooks in the same language as the project the link is from (if that is multilingual, then English)
    • sep11:In Memoriam - In Memoriam wiki

Some cases also work without the "m:" if the link is not from the project itself, see below.

  • a prefix that is "superfluous", because it refers to the same project, is allowed in the case of the prefix en:, de:, etc., w:, and m:, but not for the prefixes wiktionary:, wikibooks:, wikiquote and commons (in the project itself the last four are taken as namespace prefixes)
  • as demonstrated above by the double prefixes, links may cumulate, thus enabling links that are not possible with a single prefix:
    • links from a Wiktionary or Wikiquote to a Wikipedia other than the English one go through the English Wikipedia
    • links from a Wikipedia to a Wiktionary or Wikiquote other than the English one go through the English Wiktionary
    • links from a Wikipedia to Wikisource go through Meta
  • for portability across projects one may want to select a link code that leads to the same target from each project, e.g. m:wikibooks:Main Page. The "superfluous" m: prevents "wikibooks:" to be interpreted as namespace prefix when the code is used at wikibooks itself, while at Meta it is ignored (it is not a namespace prefix, and even at Meta itself it is recognized as code for Meta); the codes above work from all projects; however, when used on the project itself, the existence detection does not work.

Prefixed internal link style is also possible for links to various wikis and some other sites outside Wikimedia, e.g. Wiki:WelcomeVisitors and MeatBall:MeatballWiki, and Google:searchterm. A list of sites is at [2], see also Interwiki map and en:Interwiki.

A prefix other than w:, wiktionary:, wikiquote:, m:, wikibooks, a valid language code, or a valid code for an external wiki, is treated as an internal link: a namespace prefix or just the first part of the name of a page in the main namespace.

The simplest interwiki links consist of the prefix only; they lead to the main page.

Only links within a project may show as broken, leading to the edit page. Existence is not shown for links to pages of other projects, until the link is applied.

Interlanguage link in the wider sense

An interlanguage link in the wider sense includes what, for the software, is a regular link, also an internal one on projects which are shared by different languages: Meta, Wikibooks, Wikisource, Wikiquote, see:

Possible reasons for using an "interlanguage link" in the page body include:

  • control over position
  • control over label
    • especially useful in the case of a page used as a template, so that on the referring page the link label can explain what the link target is.
  • the target contains an anchor

Links to Wikimedia

Many wikis allow the prefixes WikiPedia (for the English Wikipedia) and MetaWikiPedia, which are in http://usemod.com/intermap.txt. Linking from a CamelCase-wiki (which does not use brackets for links) to a page that contains spaces in its title typically requires substitution of the spaces with underscores, e.g. WikiPedia:Main_Page. For details, refer to the wiki one wants to link from. Edit this template

See also

Help contents

Reading: Go | Search | URL | Namespace | Page name | Section | Link | Backlinks | Piped link | Interwiki link | Redirect | Variable | Category
Tracking changes: Recent | (enhanced) | Related | Watching pages | Page history | Diff | User contributions | Edit summary | Minor edit
Logging in and preferences: Logging in | Preferences | User style
Editing: Overview | New page | Images/files | Image description page | Special characters | Formula | Table | EasyTimeline | Template | Renaming (moving) a page | Automatic conversion of wikitext | Talk page | Testing
Edit this template