Manual:Interwiki/ru

Ссылки интервики - это ссылки на страницы других проектов, использующие преднастроенные внутренний стиль ссылок.

Интервики ссылки делают возможным ссылаться на статьи из (к примеру) Википедии, Викикниг, Викиновости и прочее или на википроекты на других языках (Смотри ).

Ссылка вида  будет представлена как: Main Page и будет перенаправлять на заглавную страницу Википедии.

Интервики-ссылки на другие проекты
Интервики ссылки расположены в таблице базы данных Медиавики. The list is available from the interwikimap property of the meta query API, in other words

The api interwikimap property gives incorrect results on wikis using the interwiki cache (like Wikimedia Wikis) prior to MediaWiki 1.19 (Bug 19838)

По умолчанию
Некоторые Викимедиа проекты (и другие) готовы к интервики-ссылкам по умолчанию, так что вы можете использовать их без необходимости редактирования базы данных.

Следующие несколько примеров интервики префиксов, которые возможны по умолчанию (Wikipedia is also available, 1.10 and after):

Полный список предустановленных интервики ссылок доступен по.

See m:Help:Interwiki linking for complete information on linking from/to Wikimedia projects.

In some installations none of these is pre-installed. Try  in this case.

Adding a new website for interwiki linking

 * Interwiki links are set in the  table of the database.
 * To modify these, you will need to edit the database, as below.
 * You might prefer to install an Interwiki extension, which eases the process.

As Wikipedia isn't set up by default prior to version 1.10, you might want to add it (and other projects that you desire).

The examples below show how to set up  as a link to the English Wikipedia.

The idea is to insert a line of the form:

('prefix', 'URL format string', 1, 0)

into the  table.

Single line
Advanced users may use a single command line, as follows:


 * MySQL and PostgreSQL

Newer MediaWiki versions require some extra fields such as iw_wikiid.

Export, add, re-import
Alternatively, you can use the following multi-step process, which exports the interwiki table, adds a line, then re-imports it:

('w', 'https://en.wikipedia.org/wiki/$1', 1, 0); 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 ','.
 * Export the database table
 * add to the end of the table a line of the following form (using English wikipedia as an example):
 * Import the database table

To test
To test configuration:


 * Go to your site,
 * create an article, with the following content:
 * This should display a link to the 'Village pump' page on en.Wikipedia.org (the url )
 * This should display a link to the 'Village pump' page on en.Wikipedia.org (the url )

Field documentation
In detail, the fields of the  database table are as follows:


 *  : choose a prefix, which is used for interwiki linking, e.g. "wikipedia" for linking to Wikipedia.
 * Prefixes must be all lower-case.
 *  : enter the project's URL, e.g.  for Wikipedia. Don't forget the   as it is replaced with the article's name you are linking to (  links to  ).
 * 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.
 *  : 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 w:en:fr:Wikipédia:Accueil). See m:Help:Interwiki linking.
 *  : "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
 *  : URL to the MediaWiki API, e.g.  (optional).
 *  : Database name of the wiki (If locally accessible). May be used (later?) for interwiki transclusions. (optional)

Exporting the interwiki table from a wiki
The interwiki table can be queried through the API:Meta module using.

The following JavaScript code can be used to generate the SQL INSERT statements to fill the interwiki table, when run inside the wiki where that info should be extracted, for example, injecting the code through the browser's developer tools or placing it inside Special:MyPage/ .js and previewing: