Difference between revisions of "Template:InterWiki"

From blackwiki
Jump to navigation Jump to search
imported>Tamzin
(actually, let's keep {{PAGENAME}} in as a secondary default in case something goes wrong with #language)
imported>Tamzin
(query Wikidata if no {{{code}}} is specified)
Line 1: Line 1:
 
{{sister
 
{{sister
 
|project=wikipedia
 
|project=wikipedia
|text='''''[[:{{{code}}}:| {{{1|{{#if:{{{code|}}}
+
|text='''''[[:{{{code|{{#property:P424}}}}}:| {{{1|{{#if:{{{code|{{#property:P424}}}}}
  |{{#ifeq:{{#language:{{{code}}}|en}}|{{{code}}}<!-- if an invalid or unsupported code is specified, #language just returns the same thing that was input -->
+
  |{{#ifeq:{{#language:{{{code|{{#property:P424}}}}}|en}}|{{{code|{{#property:P424}}}}}<!-- if an invalid or unsupported code is specified, #language just returns the same thing that was input -->
 
   |{{Title without disambig|{{PAGENAME}}}}
 
   |{{Title without disambig|{{PAGENAME}}}}
   |{{#language:{{{code}}}|en}}
+
   |{{#language:{{{code|{{#property:P424}}}}}|en}}
 
   }}
 
   }}
 
  }} }}} edition]]''''' of [[Wikipedia]], the free encyclopedia
 
  }} }}} edition]]''''' of [[Wikipedia]], the free encyclopedia

Revision as of 23:00, 13 July 2013

Template:Sister

50px Template documentation[view] [edit] [history] [purge]

Template:Uses Wikidata

Purpose

This template allows you to add a link from the en.wikipedia article on a language to the Wikipedia project in that language. Just add the following code to the language article in the External links section, just before the first link:

{{InterWiki|code=lang_code}}

Where lang_code is the language code as described in meta:Complete list of language Wikipedias available.

Examples

Generates boxed links to sister projects:

{{InterWiki|code=simple|Simple English}}

Renders the box:

Template:Sister

  • The wikitext:

==External links==

{{InterWiki|code=fr}}

Renders the second-level subheading External links followed by the box:
Template:Sister

See also

No description.

Template parameters

ParameterDescriptionTypeStatus
Language codecode

The language code for the language of the Wikipedia being linked

Example
es (Spanish), zh (Chinese)
Stringrequired
Language label1 article

The label to use for the link to Wikipedia in that Language

Example
Simple English
Unknownoptional