Help:Interwiki linking
Important note: When you edit this page, you agree to release your contribution into the public domain. If you don't want this or can't do this because of license restrictions, please don't edit. This page is one of the Public Domain Help Pages, which can be freely copied into fresh wiki installations and/or distributed with MediaWiki software; see Help:Contents for an overview of all pages. |
Interwiki links are links to pages of other projects, using a prefixed internal link style.
Interwiki links make it possible, to link to pages of (e.g.) Wikipedia, Wikibooks, Wikinews etc. or to your wiki-project in different languages (see Manual:Wiki family).
A link like [[Wikipedia:Main Page]]
will appear like this: Wikipedia:Main Page and redirect you to Wikipedia's Main Page.
For setting up interwiki links, you might need to edit the database. If you don't want to, you can use Extension:Special page to work with the interwiki table.
Interwiki links to other projects[edit]
Default[edit]
Several Wikimedia-Projects (and others) are ready for interwiki linking by default, so you can use them without editing your database. Note that wikipedia was only added as one of the interwiki defaults since v1.10
Adding a new website for interwiki linking[edit]
(note: advanced mySQL users may prefer to use just a single command line: INSERT INTO interwiki SET iw_prefix='(the wiki name)', iw_url='http://(the adequate URL)/$1', iw_local=1, iw_trans=0 ; - instead of exporting and re-importing the whole table interwiki content... )
- Export the database table 'interwiki' then add to the end of the table the following kayakwiki example...
- ('kayakwiki', 'http://en.kayakwiki.org/index.php/$1', 1, 0);
- Note: in the above code, the semicolon ';' as seen, MUST be at the end of the table. At the end of any other line within that table Only has ','.
- Import the database table 'interwiki'
- To test it: Go to your site, create an article, with the following content.
- [[kayakwiki:Places|]] will display a link to the 'Places' page on KayakWiki.org (the url http://en.kayakwiki.org/index.php/Places)
The following is general interwiki linking.
prefix | direction | usage example |
commons | http://commons.wikimedia.org/wiki/ | [[commons:MediaWiki]]
|
mediazilla | http://bugzilla.wikimedia.org/ | [[mediazilla:1209]]
|
meta | http://meta.wikimedia.org/wiki/ | [[meta:Main Page]]
|
mw | http://www.mediawiki.org/wiki/ | [[mw:Help:Contents]]
|
wikibooks | http://en.wikibooks.org/wiki/ | [[wikibooks:Main Page]]
|
wikimedia | http://wikimediafoundation.org/wiki/ | [[wikimedia:Main Page]]
|
wikinews | http://en.wikinews.org/wiki/ | [[wikinews:Main Page]]
|
wikiquote | http://en.wikiquote.org/wiki/ | [[wikiquote:Main Page]]
|
wikisource | http://en.wikisource.org/wiki/ | [[wikisource:Main Page]]
|
wikispecies | http://species.wikimedia.org/wiki/ | [[wikispecies:Main Page]]
|
wiktionary | http://en.wiktionary.org/wiki/ | [[wiktionary:Main Page]]
|
Note: In some installations none of these is pre-installed. Try [[metawikipedia:Main Page]]
in this case.
Adding more[edit]
As the Wikipedia isn't set up by default in version 1.9 and before, you might want to add it (and other projects of your need).
You have to edit your own database.
Go to table interwiki
and add a new line (usually done with phpMyAdmin):
iw_prefix
: choose a prefix, which is used for interwiki linking, e.g. "wikipedia" for linking to Wikipediaiw_url
: enter the project's URL, e.g.http://en.wikipedia.org/wiki/$1
for Wikipedia. Don't forget the$1
as it is replaced with the article's name you are linking to ([[Wikipedia:Main Page]]
links tohttp://en.wikipedia.org/wiki/Main_Page
).
Note: If iw_url is a binary BLOB field (SVN version, but also occurs in version 1.11.0, bug?) this won't work directly. You have to enter it as binary. There are two possible solutions: 1. You save the url in a plain text file, then import it through phpmyadmin. 2. You can directly enter an SQL query.
iw_local
: if 1, your wiki will redirect even external links of the form iw_prefix:title, not only those from its own pages. you need this if you want to use the redirect functionality from outside your wiki or other wikis use your transwiki functions for nested transwiki links (like http://en.wikipedia.org/wiki/fr:Accueil)iw_trans
: "transwiki transclusion" - set to 1 if you want to use pages from the other wiki as templates. You will also need to set $wgEnableScaryTranscluding = true in your LocalSettings.php
Interwiki links to other languages[edit]
If you have installed a Wiki family, you can link from an article in English to an article in German (if you have a German project, too). You can set up MediaWiki, to show those links in the sidebar, just below the toolbox.
In your filesystem, there is a subfolder of your MediaWiki installation, called "languages". Go there and have a look at "Names.php
" as it contains a list of known languages and their prefixes. E.g. you want to add your German project, search "Names.php
" for "Deutsch" and note the prefix "de".
If you know the "right" prefix, edit your database by adding a new line to table interwiki
:
iw_prefix
: language-prefix (e.g. "de" for German), which is listed in "Names.php
"iw_url
: URL to your wiki-project (e.g.http://de.your-wiki.org/index.php/$1
)iw_local
: same as above "Adding More"iw_trans
: same as above "Adding More"
Now, you can link an article to the same in other languages. Adding [[de:Hauptseite]]
on your english Main_Page will create a link "Deutsch" below the toolbox, which leads to the Main_Page of the German wiki (Hauptseite).
Note, that this link is shown in Sidebar's section, only, and not inside of the article. If you want to create a link inside of the text, you have to add a colon previous to the prefix: [[:de:Hauptseite]]
.
External links[edit]
MetaWiki: Help:Interwiki linking |
Languages: |
English {{#ifexist: {{#if: Help:Interwiki linking | Help:Interwiki linking | {{#if: Help | Help:}}Interwiki linking}}/ar | • {{#if: Help:Interwiki linking|العربية| العربية}}|}} {{#ifexist: {{#if: Help:Interwiki linking | Help:Interwiki linking | {{#if: Help | Help:}}Interwiki linking}}/br | • {{#if: Help:Interwiki linking|brezhoneg| brezhoneg}}|}} {{#ifexist: {{#if: Help:Interwiki linking | Help:Interwiki linking | {{#if: Help | Help:}}Interwiki linking}}/ca | • {{#if: Help:Interwiki linking|català| català}}|}} {{#ifexist: {{#if: Help:Interwiki linking | Help:Interwiki linking | {{#if: Help | Help:}}Interwiki linking}}/cs | • {{#if: Help:Interwiki linking|čeština| čeština}}|}} {{#ifexist: {{#if: Help:Interwiki linking | Help:Interwiki linking | {{#if: Help | Help:}}Interwiki linking}}/de | • {{#if: Help:Interwiki linking|Deutsch| Deutsch}}|}} {{#ifexist: {{#if: Help:Interwiki linking | Help:Interwiki linking | {{#if: Help | Help:}}Interwiki linking}}/el | • {{#if: Help:Interwiki linking|Ελληνικά| Ελληνικά}}|}} {{#ifexist: {{#if: Help:Interwiki linking | Help:Interwiki linking | {{#if: Help | Help:}}Interwiki linking}}/es | • {{#if: Help:Interwiki linking|español| español}}|}} {{#ifexist: {{#if: Help:Interwiki linking | Help:Interwiki linking | {{#if: Help | Help:}}Interwiki linking}}/fa | • {{#if: Help:Interwiki linking|فارسی| فارسی}}|}} {{#ifexist: {{#if: Help:Interwiki linking | Help:Interwiki linking | {{#if: Help | Help:}}Interwiki linking}}/fi | • {{#if: Help:Interwiki linking|suomi| suomi}}|}} {{#ifexist: {{#if: Help:Interwiki linking | Help:Interwiki linking | {{#if: Help | Help:}}Interwiki linking}}/fr | • {{#if: Help:Interwiki linking|français| français}}|}} {{#ifexist: {{#if: Help:Interwiki linking | Help:Interwiki linking | {{#if: Help | Help:}}Interwiki linking}}/gu | • {{#if: Help:Interwiki linking|ગુજરાતી| ગુજરાતી}}|}} {{#ifexist: {{#if: Help:Interwiki linking | Help:Interwiki linking | {{#if: Help | Help:}}Interwiki linking}}/he | • {{#if: Help:Interwiki linking|עברית| עברית}}|}} {{#ifexist: {{#if: Help:Interwiki linking | Help:Interwiki linking | {{#if: Help | Help:}}Interwiki linking}}/hu | • {{#if: Help:Interwiki linking|magyar| magyar}}|}} {{#ifexist: {{#if: Help:Interwiki linking | Help:Interwiki linking | {{#if: Help | Help:}}Interwiki linking}}/id | • {{#if: Help:Interwiki linking|Bahasa Indonesia| Bahasa Indonesia}}|}} {{#ifexist: {{#if: Help:Interwiki linking | Help:Interwiki linking | {{#if: Help | Help:}}Interwiki linking}}/it | • {{#if: Help:Interwiki linking|italiano| italiano}}|}} {{#ifexist: {{#if: Help:Interwiki linking | Help:Interwiki linking | {{#if: Help | Help:}}Interwiki linking}}/ja | • {{#if: Help:Interwiki linking|日本語| 日本語}}|}} {{#ifexist: {{#if: Help:Interwiki linking | Help:Interwiki linking | {{#if: Help | Help:}}Interwiki linking}}/ko | • {{#if: Help:Interwiki linking|한국어| 한국어}}|}} {{#ifexist: {{#if: Help:Interwiki linking | Help:Interwiki linking | {{#if: Help | Help:}}Interwiki linking}}/mr | • {{#if: Help:Interwiki linking|मराठी| मराठी}}|}} {{#ifexist: {{#if: Help:Interwiki linking | Help:Interwiki linking | {{#if: Help | Help:}}Interwiki linking}}/ms | • {{#if: Help:Interwiki linking|Bahasa Melayu| Bahasa Melayu}}|}} {{#ifexist: {{#if: Help:Interwiki linking | Help:Interwiki linking | {{#if: Help | Help:}}Interwiki linking}}/nl | • {{#if: Help:Interwiki linking|Nederlands| Nederlands}}|}} {{#ifexist: {{#if: Help:Interwiki linking | Help:Interwiki linking | {{#if: Help | Help:}}Interwiki linking}}/no | • {{#if: Help:Interwiki linking|norsk| norsk}}|}} {{#ifexist: {{#if: Help:Interwiki linking | Help:Interwiki linking | {{#if: Help | Help:}}Interwiki linking}}/oc | • {{#if: Help:Interwiki linking|occitan| occitan}}|}} {{#ifexist: {{#if: Help:Interwiki linking | Help:Interwiki linking | {{#if: Help | Help:}}Interwiki linking}}/pl | • {{#if: Help:Interwiki linking|polski| polski}}|}} {{#ifexist: {{#if: Help:Interwiki linking | Help:Interwiki linking | {{#if: Help | Help:}}Interwiki linking}}/pt | • {{#if: Help:Interwiki linking|português| português}}|}} {{#ifexist: {{#if: Help:Interwiki linking | Help:Interwiki linking | {{#if: Help | Help:}}Interwiki linking}}/ro | • {{#if: Help:Interwiki linking|română| română}}|}} {{#ifexist: {{#if: Help:Interwiki linking | Help:Interwiki linking | {{#if: Help | Help:}}Interwiki linking}}/ru | • {{#if: Help:Interwiki linking|русский| русский}}|}} {{#ifexist: {{#if: Help:Interwiki linking | Help:Interwiki linking | {{#if: Help | Help:}}Interwiki linking}}/si | • {{#if: Help:Interwiki linking|සිංහල| සිංහල}}|}} {{#ifexist: {{#if: Help:Interwiki linking | Help:Interwiki linking | {{#if: Help | Help:}}Interwiki linking}}/sq | • {{#if: Help:Interwiki linking|shqip| shqip}}|}} {{#ifexist: {{#if: Help:Interwiki linking | Help:Interwiki linking | {{#if: Help | Help:}}Interwiki linking}}/sr | • {{#if: Help:Interwiki linking|српски / srpski| српски / srpski}}|}} {{#ifexist: {{#if: Help:Interwiki linking | Help:Interwiki linking | {{#if: Help | Help:}}Interwiki linking}}/sv | • {{#if: Help:Interwiki linking|svenska| svenska}}|}} {{#ifexist: {{#if: Help:Interwiki linking | Help:Interwiki linking | {{#if: Help | Help:}}Interwiki linking}}/th | • {{#if: Help:Interwiki linking|ไทย| ไทย}}|}} {{#ifexist: {{#if: Help:Interwiki linking | Help:Interwiki linking | {{#if: Help | Help:}}Interwiki linking}}/vi | • {{#if: Help:Interwiki linking|Tiếng Việt| Tiếng Việt}}|}} {{#ifexist: {{#if: Help:Interwiki linking | Help:Interwiki linking | {{#if: Help | Help:}}Interwiki linking}}/yue | • {{#if: Help:Interwiki linking|粵語| 粵語}}|}} {{#ifexist: {{#if: Help:Interwiki linking | Help:Interwiki linking | {{#if: Help | Help:}}Interwiki linking}}/zh | • {{#if: Help:Interwiki linking|中文| 中文}}|}} {{#ifexist: {{#if: Help:Interwiki linking | Help:Interwiki linking | {{#if: Help | Help:}}Interwiki linking}}/zh-hans | • {{#if: Help:Interwiki linking|中文(简体)| 中文(简体)}}|}} {{#ifexist: {{#if: Help:Interwiki linking | Help:Interwiki linking | {{#if: Help | Help:}}Interwiki linking}}/zh-hant | • {{#if: Help:Interwiki linking|中文(繁體)| 中文(繁體)}}|}} |