Manual:Interwiki/ru

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

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

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



Интервики-ссылки на другие проекты
 API таблиц и запросов Интервики ссылки расположены в таблице базы данных MediaWiki. You can retrieve the interwiki list from the interwikimap property of the meta query API, in other words by making an API request like

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

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

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

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

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.

It is recommended to use the "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.

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

('w', 'https://en.wikipedia.org/wiki/$1', 1, 0);
 * 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 )

Interwiki links to other languages
If you have installed a, 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  as it contains a list of known languages and their prefixes. E.g. you want to add your German project, search  for "Deutsch" and note the prefix "de".

If you know the "right" prefix, edit your database by adding a new line to table :


 *  : language-prefix (e.g. "de" for German), which is listed in " "
 *  : URL to your wiki-project (e.g. )
 *  : same as above "Adding More"
 *  : same as above "Adding More"

Now, you can link an article to the same in other languages. Adding  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:  or set  to false.

Exporting the interwiki table from a wiki
The following JavaScript code performs the API query to retrieve the interwiki map of an existing wiki, then displays the SQL INSERT statements to fill the interwiki table on a new wiki. You run it for example by injecting the code through your browser's developer tools, or by placing it inside Special:MyPage/skinname.js and previewing.



См. также

 * (provides Special:Interwiki)
 * Help:Interwiki linking on Meta-Wiki
 * [//www.mediawiki.org/w/api.php?action=query&meta=siteinfo&siprop=interwikimap Interwiki map of MediaWiki.org ]
 * Help:Interwiki linking on Meta-Wiki
 * [//www.mediawiki.org/w/api.php?action=query&meta=siteinfo&siprop=interwikimap Interwiki map of MediaWiki.org ]
 * [//www.mediawiki.org/w/api.php?action=query&meta=siteinfo&siprop=interwikimap Interwiki map of MediaWiki.org ]