Difference between revisions of "Template:Link-interwiki/doc"

From blackwiki
Jump to navigation Jump to search
imported>Ahora
(Far better description.)
Line 1: Line 1:
 
{{Documentation subpage}}
 
{{Documentation subpage}}
 
<!-- PLEASE ADD CATEGORIES AND INTERWIKIS AT THE BOTTOM OF THIS PAGE -->
 
<!-- PLEASE ADD CATEGORIES AND INTERWIKIS AT THE BOTTOM OF THIS PAGE -->
 +
{{hatnote|{{tlx|ill}} is easier to use, providing almost the same function.}}
 +
This template ''temporarily'' displays a link to a non-English Wikipedia article, while the corresponding English-language Wikipedia article is lacking ("a red link"). The red-link is explicitly shown, followed by the non-English link. Once the English article is created, the non-English link '''won't''' be shown.
  
This template displays a link to an English-language Wikipedia article, followed by a link to a corresponding article in a non-English Wikipedia. It is typically used when the English article has not yet been created (a "red link").
+
=== Examples ===
 +
When the English article doesn't exist:
 +
* '''Usage''': <code><nowiki>{{link-interwiki|en=dependence on oil|lang=fr|lang_title=dépendance au pétrole}}</nowiki></code>
 +
* '''Result''': {{link-interwiki|en=dependence on oil|lang=fr|lang_title=dépendance au pétrole}}
 +
 
 +
Once the English article is created, the link to the other language won't be shown:
 +
* '''Usage''': <code><nowiki>{{link-interwiki|en=The Tale of Genji|lang=ja|lang_title=源氏物語}}</nowiki></code>
 +
* '''Result''': {{link-interwiki|en=The Tale of Genji|lang=ja|lang_title=源氏物語}}
 +
 
 +
{{tlx|ill}} is a similar template, but you don't specify the parameter name:
 +
* '''Usage''': {{tlx|ill|ja|Sarumino|猿蓑}}
 +
* '''Result''': {{ill|ja|Sarumino|猿蓑}}
 +
 
 +
You can modify the displaed text from the article name:
 +
* '''Usage''': <code><nowiki>{{link-interwiki|en=dependence on oil|en_text=Oil dependence|lang=fr|lang_title=dépendance au pétrole}}</nowiki></code>
 +
* '''Result''': {{link-interwiki|en=dependence on oil|en_text=Oil dependence|lang=fr|lang_title=dépendance au pétrole}}
  
 
=== Parameters ===
 
=== Parameters ===
Line 12: Line 29:
 
* '''lang''' (required) - interwiki language code, i.e. fr, nl, etc. (see [[List of Wikipedias]])
 
* '''lang''' (required) - interwiki language code, i.e. fr, nl, etc. (see [[List of Wikipedias]])
 
* '''lang_title''' (optional) - name of article in non-English Wikipedia
 
* '''lang_title''' (optional) - name of article in non-English Wikipedia
 
=== Usage ===
 
 
When the English-language article name is displayed:
 
* '''Usage''': <code><nowiki>{{link-interwiki|en=dependence on oil|lang=fr|lang_title=dépendance au pétrole}}</nowiki></code>
 
* '''Result''': {{link-interwiki|en=dependence on oil|lang=fr|lang_title=dépendance au pétrole}}
 
 
When text other than article name is displayed as link to English-language article:
 
* '''Usage''': <code><nowiki>{{link-interwiki|en=dependence on oil|en_text=Oil dependence|lang=fr|lang_title=dépendance au pétrole}}</nowiki></code>
 
* '''Result''': {{link-interwiki|en=dependence on oil|en_text=Oil dependence|lang=fr|lang_title=dépendance au pétrole}}
 
  
 
=== See also ===
 
=== See also ===
* {{tlx|ill}} - similar template using unnamed parameters
+
* {{tlx|ill}} - similar but easier template; you don't have to sepcify the parameter names.
* {{tlx|belg}} - similar template allowing links to more than one non-English Wikipedia
+
* {{tlx|ill2}} - similar template allowing links to more than one non-English Wikipedia
  
 
<includeonly>
 
<includeonly>
Line 41: Line 48:
 
[[ja:Template:仮リンク]]
 
[[ja:Template:仮リンク]]
 
[[oc:Modèl:Ligam-interwiki]]
 
[[oc:Modèl:Ligam-interwiki]]
 
 
</includeonly>
 
</includeonly>

Revision as of 01:33, 27 September 2012

This template temporarily displays a link to a non-English Wikipedia article, while the corresponding English-language Wikipedia article is lacking ("a red link"). The red-link is explicitly shown, followed by the non-English link. Once the English article is created, the non-English link won't be shown.

Examples

When the English article doesn't exist:

  • Usage: {{link-interwiki|en=dependence on oil|lang=fr|lang_title=dépendance au pétrole}}
  • Result: [[{{{1}}}]] []

Once the English article is created, the link to the other language won't be shown:

  • Usage: {{link-interwiki|en=The Tale of Genji|lang=ja|lang_title=源氏物語}}
  • Result: [[{{{1}}}]] []

{{ill}} is a similar template, but you don't specify the parameter name:

You can modify the displaed text from the article name:

  • Usage: {{link-interwiki|en=dependence on oil|en_text=Oil dependence|lang=fr|lang_title=dépendance au pétrole}}
  • Result: [[{{{1}}}]] []

Parameters

The template accepts the following named parameters:

  • en (required) - name of article in English-language Wikipedia
  • en_text (optional) - text to display for English-language link, if different than the article name
  • lang (required) - interwiki language code, i.e. fr, nl, etc. (see List of Wikipedias)
  • lang_title (optional) - name of article in non-English Wikipedia

See also

  • {{ill}} - similar but easier template; you don't have to sepcify the parameter names.
  • {{ill2}} - similar template allowing links to more than one non-English Wikipedia