Editing Help:Interwiki linking

From BRL-CAD

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision Your text
Line 1: Line 1:
{{PD Help Page}}
 
 
'''Interwiki links''' are links to pages of other projects, using a prefixed internal link style.
 
'''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]]).  
 
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 <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.
 +
 
 +
For setting up interwiki links, you might need to edit the Database.
  
 
==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. However, the mother of all Wikimedia-projects &mdash; the Wikipedia itself &mdash; is for some reason missing.
 
 
The following are some examples of interwiki prefixes which are available by default:
 
 
{| {{prettytable}}
 
{| {{prettytable}}
 
|{{Hl3}} align="center"|'''prefix'''
 
|{{Hl3}} align="center"|'''prefix'''
|{{Hl3}} align="center"|'''destination URL'''
+
|{{Hl3}} align="center"|'''direction'''
 
|{{Hl3}} align="center"|'''usage example'''
 
|{{Hl3}} align="center"|'''usage example'''
 
|-
 
|-
Line 21: Line 20:
 
|-
 
|-
 
|mediazilla
 
|mediazilla
|<nowiki>http://bugzilla.wikimedia.org/</nowiki>
+
|<nowiki>http://bugzilla.wikipedia.org/</nowiki>
 
|<code><nowiki>[[mediazilla:1209]]</nowiki></code>
 
|<code><nowiki>[[mediazilla:1209]]</nowiki></code>
 
|-
 
|-
Line 49: Line 48:
 
|-
 
|-
 
|wikisource
 
|wikisource
|<nowiki>http://en.wikisource.org/wiki/</nowiki>
+
|<nowiki>http://sources.wikipedia.org/wiki/</nowiki>
 
|<code><nowiki>[[wikisource:Main Page]]</nowiki></code>
 
|<code><nowiki>[[wikisource:Main Page]]</nowiki></code>
 
|-
 
|-
 
|wikispecies
 
|wikispecies
|<nowiki>http://species.wikimedia.org/wiki/</nowiki>
+
|<nowiki>http://species.wikipedia.org/wiki/</nowiki>
 
|<code><nowiki>[[wikispecies:Main Page]]</nowiki></code>
 
|<code><nowiki>[[wikispecies:Main Page]]</nowiki></code>
 
|-
 
|-
Line 59: Line 58:
 
|<nowiki>http://en.wiktionary.org/wiki/</nowiki>
 
|<nowiki>http://en.wiktionary.org/wiki/</nowiki>
 
|<code>  <nowiki>[[wiktionary:Main Page]]</nowiki></code>
 
|<code>  <nowiki>[[wiktionary:Main Page]]</nowiki></code>
|-
 
|wikipedia
 
|<nowiki>http://en.wikipedia.org/wiki/</nowiki>
 
|<code>  <nowiki>[[wikipedia:Main Page]]</nowiki></code>
 
 
|-
 
|-
 
|}
 
|}
  
{{Note|In some installations none of these is pre-installed. Try <code><nowiki>[[metawikipedia:Main Page]]</nowiki></code> in this case.}}
+
===Adding more===
 
+
As the Wikipedia isn't set up by default, you might want to add it (and other projects of your need).
===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]].
 
 
 
{{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 <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...
 
* <nowiki>('kayakwiki', 'http://en.kayakwiki.org/index.php/$1', 1, 0);</nowiki>
 
*:{{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.
 
* <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).
+
You have to edit your own database.  
 
+
Go to table <code>interwiki</code> and add a new line:
The fields of the <code>interwiki</code> database table are as follows:
+
*'''<code>iw_prefix</code>''': choose a prefix, which is used for interwiki linking, e.g. "Wikipedia" or "wp" for linking to Wikipedia
*'''<code>iw_prefix</code>''': choose a prefix, which is used for interwiki linking, e.g. "wikipedia" for linking to Wikipedia.
+
*'''<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|Prefixes '''must''' be all lower-case.}}
 
*'''<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>).<br/>
 
*:{{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.}} 
 
 
 
*'''<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)
 
*'''<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)
*'''<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''
+
*'''<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 ''$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=<nowiki>http:</nowiki>//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=http://www.mediawiki.org/wiki/Manual:$1''
 
}}
 
}}
  
Line 112: Line 91:
  
 
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: <code><nowiki>[[:de:Hauptseite]]</nowiki></code>.
 
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: <code><nowiki>[[:de:Hauptseite]]</nowiki></code>.
 
==See also==
 
* [[Extension:SpecialInterwiki]]
 
 
==External links==
 
{{meta|Help:Interwiki linking}}
 
 
{{Languages|Help:Interwiki linking}}
 
  
 
[[Category:Help|Interwiki linking]]
 
[[Category:Help|Interwiki linking]]
[[Category:Interwiki]]
 

Please note that all contributions to BRL-CAD may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see BRL-CAD:Copyrights for details). Do not submit copyrighted work without permission!

To edit this page, please answer the question that appears below (more info):

Cancel Editing help (opens in new window)