Help:Interwiki linking: Difference between revisions
(No difference)
|
Revision as of 03:35, 23 January 2007
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 codenowikiWikipedia:Main Page/nowiki/code 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.
Interwiki links to other projects
Default
Several Wikimedia-Projects (and others) are ready for interwiki linking by default, so you can use them without editing your database. However, the mother of all Wikimedia-projects mdash; the Wikipedia itself mdash; is for some reason missing.
bgcolor=#8DA7D6 noinclude/noinclude align=center|prefix | bgcolor=#8DA7D6 noinclude/noinclude align=center|direction | bgcolor=#8DA7D6 noinclude/noinclude align=center|usage example |
commons | nowikihttp://commons.wikimedia.org/wiki//nowiki | codenowikicommons:MediaWiki/nowiki/code |
mediazilla | nowikihttp://bugzilla.wikipedia.org//nowiki | codenowikimediazilla:1209/nowiki/code |
meta | nowikihttp://meta.wikimedia.org/wiki//nowiki | codenowikimeta:Main Page/nowiki/code |
mw | nowikihttp://www.mediawiki.org/wiki//nowiki | codenowikimw:Help:Contents/nowiki/code |
wikibooks | nowikihttp://en.wikibooks.org/wiki//nowiki | codenowikiwikibooks:Main Page/nowiki/code |
wikimedia | nowikihttp://wikimediafoundation.org/wiki//nowiki | codenowikiwikimedia:Main Page/nowiki/code |
wikinews | nowikihttp://en.wikinews.org/wiki//nowiki | codenowikiwikinews:Main Page/nowiki/code |
wikiquote | nowikihttp://en.wikiquote.org/wiki//nowiki | codenowikiwikiquote:Main Page/nowiki/code |
wikisource | nowikihttp://sources.wikipedia.org/wiki//nowiki | codenowikiwikisource:Main Page/nowiki/code |
wikispecies | nowikihttp://species.wikipedia.org/wiki//nowiki | codenowikiwikispecies:Main Page/nowiki/code |
wiktionary | nowikihttp://en.wiktionary.org/wiki//nowiki | code nowikiwiktionary:Main Page/nowiki/code |
Adding more
As the Wikipedia isn't set up by default, you might want to add it (and other projects of your need).
You have to edit your own database. Go to table codeinterwiki/code and add a new line:
- codeiw_prefix/code: choose a prefix, which is used for interwiki linking, e.g. Wikipedia or wp for linking to Wikipedia
- codeiw_url/code: enter the project's URL, e.g. codenowikihttp://en.wikipedia.org/wiki/$1/nowiki/code for Wikipedia. Don't forget the code$1/code as it is replaced with the article's name you are linking to (codenowikiWikipedia:Main Page/nowiki/code links to codenowikihttp://en.wikipedia.org/wiki//nowikiMain_Page/code).
- codeiw_local/code: 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)
- codeiw_trans/code: 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
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 codeNames.php/code as it contains a list of known languages and their prefixes. E.g. you want to add your German project, search codeNames.php/code for Deutsch and note the prefix de.
If you know the right prefix, edit your database by adding a new line to table codeinterwiki/code:
- codeiw_prefix/code: language-prefix (e.g. de for German), which is listed in codeNames.php/code
- codeiw_url/code: URL to your wiki-project (e.g. codenowikihttp://de.your-wiki.org/index.php/$1/nowiki/code)
- codeiw_local/code: same as above Adding More
- codeiw_trans/code: same as above Adding More
Now, you can link an article to the same in other languages. Adding codenowikide:Hauptseite/nowiki/code 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: codenowikide:Hauptseite/nowiki/code.