Help:Interwiki linking

From WagaWiki

Revision as of 00:47, 12 June 2006 by Bdk (Talk)
(diff) ← Older revision | Current revision (diff) | Newer revision → (diff)
Jump to: navigation, search
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.

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 Help: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.

Contents

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:

Template:Hl3 align="center"|prefix Template:Hl3 align="center"|direction Template:Hl3 align="center"|usage example
commons http://commons.wikimedia.org/wiki/ [[commons:MediaWiki]]
mediazilla http://bugzilla.wikipedia.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://sources.wikipedia.org/wiki/ [[wikisource:Main Page]]
wikispecies http://species.wikipedia.org/wiki/ [[wikispecies:Main Page]]
wiktionary http://en.wiktionary.org/wiki/ [[wiktionary:Main Page]]

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 database. Go to table interwiki and add a new line:

  • iw_prefix: choose a prefix, which is used for interwiki linking, e.g. "Wikipedia" or "wp" for linking to Wikipedia
  • iw_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 to http://en.wikipedia.org/wiki/Main_Page).
  • iw_local: (don't know what this is for)
  • iw_trans: (don't know what this is for)

Interwiki links to other languages

File:M-en-interwiki lang.png
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 "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: (don't know what this is for)
  • iw_trans: (don't know what this is for)


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]].

Personal tools