Release status: stable | |
|---|---|
| Implementation | Special page |
| Description | Adds a special page to view and manipulate theinterwiki table |
| Author(s) | Stephanie Amanda Stevens,SPQRobin |
| Latest version | 4.0 |
| MediaWiki | 1.36—1.43 |
| Database changes | No |
| License | GNU General Public License 2.0 or later |
| Download | |
| Example | Special:Interwiki |
| |
interwiki | |
| Translate the Interwiki extension if it is available at translatewiki.net | |
| Issues | Open tasks ·Report a bug |
TheInterwiki extension adds theSpecial:Interwiki page toMediaWiki, to view and edit theinterwiki table, and a log of any actions made with it.
This extension works with the$wgInterwikiCache variable.Changes made with it to theinterwiki table can affect the behavior of bothtransclusion andinterwiki links.
The list ofSpecial:Interwiki is identical to theAPIapi.php?action=query&meta=siteinfo&siprop=interwikimap, except theiw_api field is not available.
Interwiki folder to yourextensions/ directory.cdextensions/gitclonehttps://gerrit.wikimedia.org/r/mediawiki/extensions/InterwikiwfLoadExtension('Interwiki');// To grant a group (e.g., the "sysop" group) permission to edit interwiki data$wgGroupPermissions['sysop']['interwiki']=true;
$wgEnableScaryTranscluding.Special:Interwiki interface, set$wgInterwikiViewOnly totrue.interwiki message item defined per locale inSpecialInterwiki.i18n.php. Its value isView and edit interwiki data.To set up interlanguage links using this extension, make sure that$wgInterwikiMagic is set totrue and$wgHideInterlanguageLinks is set tofalse (they are like this by default, you don't need to change them usually).The$wgInterwikiViewOnly also needs to be set tofalse (which it is by default).Then go toSpecial:Interwiki as a user with the ability to edit interwikis.That is controlled by theinterwiki permission, and by default, no user group has this permission, so it needs to be added to a user group with, e.g.
$wgGroupPermissions['sysop']['interwiki']=true;
Once onSpecial:Interwiki, you can either click theAdd an interwiki or language prefix link at the top of the table, or click theEdit orDelete links in the table row of an existing interwiki prefix.
Choosing to add or edit an interwiki prefix will take you to a separate page with a form with various fields to be filled.The main fields arename, which is the prefix that would be used for the links, andURL, where you put the full URL pattern.For example, settingname=foowiki andURL=http://fr.foowiki.tld/wiki/$1 would make[[foowiki:Blah]] point tohttp://fr.foowiki.tld/wiki/Blah.
There are also two checkboxes labeledForward andTransclude.SeeManual:Interwiki table for a full explanation of the forward (iw_local) and transclude (iw_trans) bits.
In brief:
local=true) is normally done between all languages and projects in the same group, as it allows a link to any one of the languages to be used as a gateway to the others. The English-language Wikipedia, for instance, sets thelocal bittrue for all of the other-language Wikipedias and for projects likecommons:,wikinews: orwikivoyage:. A user on a wiki outside Wikipedia where thewikipedia: interwiki prefix points toen.wikipedia.org could create a link likewikipedia:fr:Encyclopédie. That link goes initially tofr:Encyclopédie on the English-language Wikipedia. Theen.wikipedia server immediately recognisesfr: as alocal interwiki link, so replies with a redirect to la Wikipédia wherefr.wikipedia.org/wiki/Encyclopédie displays the requested French-language Wikipédia page [[Encyclopédie]] et voilà.Since version 3, Interwiki supports defining a global/central database and pulling defined interwikis from there as well as from the local table.This functions essentially as a table merge, with local interwiki definitions overriding central.Language links are not pulled from the central table; these are set up as local-only due to a central table likely serving more than one project (with each having its own languages).
The central table is the interwiki table of the central wiki.This means that as far as the central wiki is concerned, it is basically just a normal non-global setup.There are therefore no special rights associated with the central (global) table, though it is likely you may want to be more picky about how you assign the 'interwiki' edit right on this wiki.
To set up a central interwiki table, simply provide the name of the database of the wiki you want to use:
// Enable pulling global interwikis from a central database$wgInterwikiCentralDB='mw_central';
Replace'mw_central' with the name of the database.
For those using table prefixes here is an alternative solution forpool_example_wiki tables.
$wgSharedDB='example_wiki';# The $wgDBname for the wiki database holding the main interwiki table$wgSharedPrefix='pool_';# The $wgDBprefix for the database. Defaults to the prefix of the current wiki if not specified$wgSharedTables=['interwiki'];
You can useprotocol-relative URLs (PRURLs), so that users accessing your wiki over either HTTP or HTTPS can use that same protocol to access interwiki links.To use a PRURL, first ensure the destination server supports HTTPS; if it does, then simply remove thehttps: portion of the URL in the link table.For example, change
https://en.wikipedia.org/wiki/$1
to:
//en.wikipedia.org/wiki/$1
| This extension is being used on one or moreWikimedia projects. This probably means that the extension is stable and works well enough to be used by such high-traffic websites. Look for this extension's name in Wikimedia'sCommonSettings.php andInitialiseSettings.php configuration files to see where it's installed. A full list of the extensions installed on a particular wiki can be seen on the wiki'sSpecial:Version page. |
| This extension is included in the following wiki farms/hosts and/or packages:This is not an authoritative list. Some wiki farms/hosts and/or packages may contain this extension even if they are not listed here. Always check with your wiki farms/hosts or bundle to confirm. |