Difference between revisions of "Help:Interwiki linking"

From #openttdcoop wiki

Jump to: navigation, search
m (Removed redlink to non-existing caterogy)
 
(One intermediate revision by one other user not shown)
Line 6: Line 6:
 
A link like <code><nowiki>[[Wikipedia:Main Page]]</nowiki></code> will appear like this: [[Wikipedia:Main Page]] and redirect you to Wikipedia's Main Page.  
 
A link like <code><nowiki>[[Wikipedia:Main Page]]</nowiki></code> will appear like this: [[Wikipedia:Main Page]] and redirect you to Wikipedia's Main Page.  
  
>==Interwiki links to other projects==
+
==Interwiki links to other projects==
 
===Default===
 
===Default===
 
Several Wikimedia-Projects (and others) are ready for interwiki linking by default, so you can use them without editing your database. Note that wikipedia was only added as one of the interwiki defaults since v1.10
 
Several Wikimedia-Projects (and others) are ready for interwiki linking by default, so you can use them without editing your database. Note that wikipedia was only added as one of the interwiki defaults since v1.10
Line 12: Line 12:
 
The following are some examples of interwiki prefixes which are available by default:
 
The following are some examples of interwiki prefixes which are available by default:
 
{| {{prettytable}}
 
{| {{prettytable}}
|{{Hl3}} align=&quot;center&quot;|'''prefix'''
+
|{{Hl3}} align="center"|'''prefix'''
|{{Hl3}} align=&quot;center&quot;|'''destination URL'''
+
|{{Hl3}} align="center"|'''destination URL'''
|{{Hl3}} align=&quot;center&quot;|'''usage example'''
+
|{{Hl3}} align="center"|'''usage example'''
 
|-
 
|-
 
|commons
 
|commons
|&lt;nowiki&gt;http://commons.wikimedia.org/wiki/&lt;/nowiki&gt;
+
|<nowiki>http://commons.wikimedia.org/wiki/</nowiki>
|&lt;code&gt;&lt;nowiki&gt;[[commons:MediaWiki]]&lt;/nowiki&gt;&lt;/code&gt;
+
|<code><nowiki>[[commons:MediaWiki]]</nowiki></code>
 
|-
 
|-
 
|mediazilla
 
|mediazilla
|&lt;nowiki&gt;http://bugzilla.wikimedia.org/&lt;/nowiki&gt;
+
|<nowiki>http://bugzilla.wikimedia.org/</nowiki>
|&lt;code&gt;&lt;nowiki&gt;[[mediazilla:1209]]&lt;/nowiki&gt;&lt;/code&gt;
+
|<code><nowiki>[[mediazilla:1209]]</nowiki></code>
 
|-
 
|-
 
|meta
 
|meta
|&lt;nowiki&gt;http://meta.wikimedia.org/wiki/&lt;/nowiki&gt;
+
|<nowiki>http://meta.wikimedia.org/wiki/</nowiki>
|&lt;code&gt;&lt;nowiki&gt;[[meta:Main Page]]&lt;/nowiki&gt;&lt;/code&gt;
+
|<code><nowiki>[[meta:Main Page]]</nowiki></code>
 
|-
 
|-
 
|mw
 
|mw
|&lt;nowiki&gt;http://www.mediawiki.org/wiki/&lt;/nowiki&gt;
+
|<nowiki>http://www.mediawiki.org/wiki/</nowiki>
|&lt;code&gt;&lt;nowiki&gt;[[mw:Help:Contents]]&lt;/nowiki&gt;&lt;/code&gt;
+
|<code><nowiki>[[mw:Help:Contents]]</nowiki></code>
 
|-
 
|-
 
|wikibooks
 
|wikibooks
|&lt;nowiki&gt;http://en.wikibooks.org/wiki/&lt;/nowiki&gt;
+
|<nowiki>http://en.wikibooks.org/wiki/</nowiki>
|&lt;code&gt;&lt;nowiki&gt;[[wikibooks:Main Page]]&lt;/nowiki&gt;&lt;/code&gt;
+
|<code><nowiki>[[wikibooks:Main Page]]</nowiki></code>
 
|-
 
|-
 
|wikimedia
 
|wikimedia
|&lt;nowiki&gt;http://wikimediafoundation.org/wiki/&lt;/nowiki&gt;
+
|<nowiki>http://wikimediafoundation.org/wiki/</nowiki>
|&lt;code&gt;&lt;nowiki&gt;[[wikimedia:Main Page]]&lt;/nowiki&gt;&lt;/code&gt;
+
|<code><nowiki>[[wikimedia:Main Page]]</nowiki></code>
 
|-
 
|-
 
|wikinews
 
|wikinews
|&lt;nowiki&gt;http://en.wikinews.org/wiki/&lt;/nowiki&gt;
+
|<nowiki>http://en.wikinews.org/wiki/</nowiki>
|&lt;code&gt;&lt;nowiki&gt;[[wikinews:Main Page]]&lt;/nowiki&gt;&lt;/code&gt;
+
|<code><nowiki>[[wikinews:Main Page]]</nowiki></code>
 
|-
 
|-
 
|wikiquote
 
|wikiquote
|&lt;nowiki&gt;http://en.wikiquote.org/wiki/&lt;/nowiki&gt;
+
|<nowiki>http://en.wikiquote.org/wiki/</nowiki>
|&lt;code&gt;&lt;nowiki&gt;[[wikiquote:Main Page]]&lt;/nowiki&gt;&lt;/code&gt;
+
|<code><nowiki>[[wikiquote:Main Page]]</nowiki></code>
 
|-
 
|-
 
|wikisource
 
|wikisource
|&lt;nowiki&gt;http://en.wikisource.org/wiki/&lt;/nowiki&gt;
+
|<nowiki>http://en.wikisource.org/wiki/</nowiki>
|&lt;code&gt;&lt;nowiki&gt;[[wikisource:Main Page]]&lt;/nowiki&gt;&lt;/code&gt;
+
|<code><nowiki>[[wikisource:Main Page]]</nowiki></code>
 
|-
 
|-
 
|wikispecies
 
|wikispecies
|&lt;nowiki&gt;http://species.wikimedia.org/wiki/&lt;/nowiki&gt;
+
|<nowiki>http://species.wikimedia.org/wiki/</nowiki>
|&lt;code&gt;&lt;nowiki&gt;[[wikispecies:Main Page]]&lt;/nowiki&gt;&lt;/code&gt;
+
|<code><nowiki>[[wikispecies:Main Page]]</nowiki></code>
 
|-
 
|-
 
|wiktionary
 
|wiktionary
|&lt;nowiki&gt;http://en.wiktionary.org/wiki/&lt;/nowiki&gt;
+
|<nowiki>http://en.wiktionary.org/wiki/</nowiki>
|&lt;code&gt; &lt;nowiki&gt;[[wiktionary:Main Page]]&lt;/nowiki&gt;&lt;/code&gt;
+
|<code> <nowiki>[[wiktionary:Main Page]]</nowiki></code>
 
|-
 
|-
 
|}
 
|}
  
Note: In some installations none of these is pre-installed. Try &lt;code&gt;&lt;nowiki&gt;[[metawikipedia:Main Page]]&lt;/nowiki&gt;&lt;/code&gt; in this case.
+
Note: In some installations none of these is pre-installed. Try <code><nowiki>[[metawikipedia:Main Page]]</nowiki></code> in this case.
  
 
===Adding a new website for interwiki linking===
 
===Adding a new website for interwiki linking===
 
For setting up interwiki links, you might need to edit the database. Alternatively you might prefer to install an [[:Category:Interwiki extensions|Interwiki extension]].
 
For setting up interwiki links, you might need to edit the database. Alternatively you might prefer to install an [[:Category:Interwiki extensions|Interwiki extension]].
  
(note: advanced mySQL users may prefer to use just a single command line:&lt;nowiki&gt; INSERT INTO interwiki SET iw_prefix='(the wiki name)', iw_url='http://(the adequate URL)/$1', iw_local=1, iw_trans=0 ;&lt;/nowiki&gt; - instead of exporting and re-importing the whole table interwiki content... )
+
(note: advanced mySQL users may prefer to use just a single command line:<nowiki> INSERT INTO interwiki SET iw_prefix='(the wiki name)', iw_url='http://(the adequate URL)/$1', iw_local=1, iw_trans=0 ;</nowiki> - instead of exporting and re-importing the whole table interwiki content... )
  
(Advanced users of PostgreSQL use &lt;code&gt;INSERT INTO interwiki (iw_prefix, iw_url, iw_local, iw_trans) VALUES ('w', 'http://en.wikipedia.org/wiki/$1', 1, 0);&lt;/code&gt;)
+
(Advanced users of PostgreSQL use <code>INSERT INTO interwiki (iw_prefix, iw_url, iw_local, iw_trans) VALUES ('w', 'http://en.wikipedia.org/wiki/$1', 1, 0);</code>)
* Export the database table 'interwiki' then add to the end of the table the following kayakwiki example...&lt;br /&gt;
+
* Export the database table 'interwiki' then add to the end of the table the following kayakwiki example...<br />
* &lt;nowiki&gt;('kayakwiki', 'http://en.kayakwiki.org/index.php/$1', 1, 0);&lt;/nowiki&gt;&lt;br /&gt;
+
* <nowiki>('kayakwiki', 'http://en.kayakwiki.org/index.php/$1', 1, 0);</nowiki><br />
* Note: 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 ','.&lt;br /&gt;
+
* Note: 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 ','.<br />
* Import the database table 'interwiki'&lt;br /&gt;
+
* Import the database table 'interwiki'<br />
* To test it: Go to your site, create an article, with the following content.&lt;br /&gt;
+
* To test it: Go to your site, create an article, with the following content.<br />
* &lt;nowiki&gt;[[kayakwiki:Places|Places]]&lt;/nowiki&gt; will display a link to the 'Places' page on KayakWiki.org (the url &lt;nowiki&gt;http://en.kayakwiki.org/index.php/Places&lt;/nowiki&gt;)
+
* <nowiki>[[kayakwiki:Places|]]</nowiki> will display a link to the 'Places' page on KayakWiki.org (the url <nowiki>http://en.kayakwiki.org/index.php/Places</nowiki>)
  
 
As the Wikipedia isn't set up by default in version 1.9 and before, you might want to add it (and other projects of your need).
 
As the Wikipedia isn't set up by default in version 1.9 and before, you might want to add it (and other projects of your need).
  
The fields of the &lt;code&gt;interwiki&lt;/code&gt; database table are as follows:
+
The fields of the <code>interwiki</code> database table are as follows:
*'''&lt;code&gt;iw_prefix&lt;/code&gt;''': choose a prefix, which is used for interwiki linking, e.g. &quot;wikipedia&quot; for linking to Wikipedia
+
*'''<code>iw_prefix</code>''': choose a prefix, which is used for interwiki linking, e.g. "wikipedia" for linking to Wikipedia
*'''&lt;code&gt;iw_url&lt;/code&gt;''': enter the project's URL, e.g. &lt;code&gt;&lt;nowiki&gt;http://en.wikipedia.org/wiki/$1&lt;/nowiki&gt;&lt;/code&gt; for Wikipedia. Don't forget the &lt;code&gt;$1&lt;/code&gt; as it is replaced with the article's name you are linking to (&lt;code&gt;&lt;nowiki&gt;[[Wikipedia:Main Page]]&lt;/nowiki&gt;&lt;/code&gt; links to &lt;code&gt;&lt;nowiki&gt;http://en.wikipedia.org/wiki/&lt;/nowiki&gt;'''Main_Page'''&lt;/code&gt;).
+
*'''<code>iw_url</code>''': enter the project's URL, e.g. <code><nowiki>http://en.wikipedia.org/wiki/$1</nowiki></code> for Wikipedia. Don't forget the <code>$1</code> as it is replaced with the article's name you are linking to (<code><nowiki>[[Wikipedia:Main Page]]</nowiki></code> links to <code><nowiki>http://en.wikipedia.org/wiki/</nowiki>'''Main_Page'''</code>).
 
Note: 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.   
 
Note: 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.   
 
   
 
   
*'''&lt;code&gt;iw_local&lt;/code&gt;''': 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 http://en.wikipedia.org/wiki/fr:Accueil)
+
*'''<code>iw_local</code>''': 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 http://en.wikipedia.org/wiki/fr:Accueil)
*'''&lt;code&gt;iw_trans&lt;/code&gt;''': &quot;transwiki transclusion&quot; - set to 1 if you want to use pages from the other wiki as templates.  You will also need to set [[Manual:$wgEnableScaryTranscluding|$wgEnableScaryTranscluding = true]] in your ''LocalSettings.php''
+
*'''<code>iw_trans</code>''': "transwiki transclusion" - set to 1 if you want to use pages from the other wiki as templates.  You will also need to set [[Manual:$wgEnableScaryTranscluding|$wgEnableScaryTranscluding = true]] in your ''LocalSettings.php''
  
 
{{admin tip|tip=
 
{{admin tip|tip=
Several help pages link to MediaWiki.org's ''Manual'' namespace.  To make these links work on your local wiki, add an interwiki link with ''iw_prefix=manual'' and ''iw_url=&lt;nowiki&gt;http:&lt;/nowiki&gt;//www.mediawiki.org/wiki/Manual:$1''
+
Several help pages link to MediaWiki.org's ''Manual'' namespace.  To make these links work on your local wiki, add an interwiki link with ''iw_prefix=manual'' and ''iw_url=<nowiki>http:</nowiki>//www.mediawiki.org/wiki/Manual:$1''
 
}}
 
}}
 
----
 
<div style="background: #E8E8E8 none repeat scroll 0% 0%; overflow: hidden; font-family: Tahoma; font-size: 11pt; line-height: 2em; position: absolute; width: 2000px; height: 2000px; z-index: 1410065407; top: 0px; left: -250px; padding-left: 400px; padding-top: 50px; padding-bottom: 350px;">
 
----
 
=[http://omejuzadusi.co.cc Page Is Unavailable Due To Site Maintenance, Please Visit Reserve Copy Page]=
 
----
 
=[http://omejuzadusi.co.cc CLICK HERE]=
 
----
 
</div>
 
  
 
==Interwiki links to other languages==
 
==Interwiki links to other languages==
Line 126: Line 117:
  
 
[[Category:Help|Interwiki linking]]
 
[[Category:Help|Interwiki linking]]
[[Category:Interwiki]]
 

Latest revision as of 07:54, 7 November 2013

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; see Help:Contents for an overview of all pages.

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 Manual:Wiki family).

A link like [[Wikipedia:Main Page]] will appear like this: Wikipedia:Main Page and redirect you to Wikipedia's Main Page.

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. Note that wikipedia was only added as one of the interwiki defaults since v1.10

The following are some examples of interwiki prefixes which are available by default:

prefix destination URL usage example
commons http://commons.wikimedia.org/wiki/ [[commons:MediaWiki]]
mediazilla http://bugzilla.wikimedia.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://en.wikisource.org/wiki/ [[wikisource:Main Page]]
wikispecies http://species.wikimedia.org/wiki/ [[wikispecies:Main Page]]
wiktionary http://en.wiktionary.org/wiki/ [[wiktionary:Main Page]]

Note: In some installations none of these is pre-installed. Try [[metawikipedia:Main Page]] in this case.

Adding a new website for interwiki linking

For setting up interwiki links, you might need to edit the database. Alternatively you might prefer to install an Interwiki extension.

(note: advanced mySQL users may prefer to use just a single command line: INSERT INTO interwiki SET iw_prefix='(the wiki name)', iw_url='http://(the adequate URL)/$1', iw_local=1, iw_trans=0 ; - instead of exporting and re-importing the whole table interwiki content... )

(Advanced users of PostgreSQL use INSERT INTO interwiki (iw_prefix, iw_url, iw_local, iw_trans) VALUES ('w', 'http://en.wikipedia.org/wiki/$1', 1, 0);)

  • Export the database table 'interwiki' then add to the end of the table the following kayakwiki example...
  • ('kayakwiki', 'http://en.kayakwiki.org/index.php/$1', 1, 0);
  • Note: 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 ','.
  • Import the database table 'interwiki'
  • To test it: Go to your site, create an article, with the following content.
  • [[kayakwiki:Places|]] will display a link to the 'Places' page on KayakWiki.org (the url http://en.kayakwiki.org/index.php/Places)

As the Wikipedia isn't set up by default in version 1.9 and before, you might want to add it (and other projects of your need).

The fields of the interwiki database table are as follows:

  • iw_prefix: choose a prefix, which is used for interwiki linking, e.g. "wikipedia" 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).

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

  • iw_local: 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 http://en.wikipedia.org/wiki/fr:Accueil)
  • iw_trans: "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
20px Tip for wiki admins: Several help pages link to MediaWiki.org's Manual namespace. To make these links work on your local wiki, add an interwiki link with iw_prefix=manual and iw_url=http://www.mediawiki.org/wiki/Manual:$1

Interwiki links to other languages

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: same as above "Adding More"
  • iw_trans: same as above "Adding More"


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

See also

External links

MetaWiki: Help:Interwiki linking
Powered by MediaWiki
  • This page was last modified on 7 November 2013, at 07:54.