Configuring interwiki linking

From Pirates@Home

Jump to: navigation, search

Interwiki linking allows one to easily create a link to another wiki, such as the Wikipedia or Wiktionary, or a glossary for a sister I2U2 project, without having to enter the full URL. So, for example, a link to the LIGO glossary for a definition of the term "DMT" could be coded as [[:ligo_g:DMT|DMT]].

The interwiki link information is stored in a database table called 'interwiki'. It contains the interwiki prefix (the thing which goes between colons in the link), a URL template (with $1 representing the link text) and "local" flag. If the local flag is "1" then local links are used, othewise links are marked as external. This works even for non-wiki links, so one can link to other parts of a project, such as the Pirates@Home main web site, and the links can be local links.


Configuration

When first installed, Mediawiki 1.6.7 has 174 entries in the interwiki table, which include the wiktionary but not the wikipedea or the "Meta" wiki, which has many useful help pages. This was confusing. One solution to the problem is to run an SQL script to add the Wikipedia definitions for wikipedia, as described in Meta at Meta:Help:Guide for system administrators for setting up interwiki linking. This is, however, overkill.

Another approach is to edit a separate file, which I called custom-interwiki.sql, containing only the definitions for interwiki maps we wish to use, and then run that through SQL. That worked.

Personal tools