Template:Wp/doc

From MozillaWiki
Jump to: navigation, search
Edit-copy green.svg
This is a documentation subpage for Template:Wp.
It contains usage information, categories and other content that is not part of the original template page.

Usage

{{wp}} creates a customized, named interwiki link to a Wikipedia article at the position where you place the template. It is possible to choose a Wikipedia language server and to replace the article's name with a custom link text.

The template is useful for easy linking to Wikipedia articles in any of the available Wikipedia language servers.

Parameters

There are 3 parameters, all unnamed and optional. If no parameters at all are entered, the template will output a link to the English Wikipedia main page.

Syntax

The syntax for the template is:

{{wp |article name |custom link text |language code }}

Optional parameters

1

Article name

This is the parameter for entering the name of the article on Wikipedia, you wish to link to.

Notes
  • The article name has to be written exactly as it is on the Wikipedia page; i.e. with diacritics and not translated (e.g. for the Swedish Wikipedia article on the Swedish judicial system's courts of appeal, "Hovrätt", you have to write Hovrätt, and not Hovratt, Hovraett, or Court of appeal). If you want the link to show something other than the article's name, use the custom link text parameter.
Usage
  • {{wp|1}}

2

Custom link text

With this parameter, you can define an custom text string to be shown instead of the Wikipedia article's name. No parameter name needs to be entered.

Notes
  • To skip this parameter, and only use the 1st and the 3rd parameters, leave it empty by typing two pipes in a row, following the syntax {{wp|1|(empty)|3}}.
Example: to create a link to the article Article in French Wikipedia, you type {{wp|Article||fr}}.
Usage
  • {{wp|1|2}}

3

Wikipedia language code

The link produced by {{wp}} leads, by default, to English Wikipedia (en.wikipedia.org). If you want to link to another language version of Wikipedia, e.g. Swedish Wikipedia (sv.wikipedia.org), you can use this parameter and enter the language code for the Wikipedia you wish to link to. Here's a list of Wikipedia language versions, complete with current language codes.

Notes
  • The use of interwiki links means, in this case, that the output link will point to the English Wikipedia server, and then be redirected from there to the language server you have specified. If, for example, the template is instructed to produce a link to the article Article in French Wikipedia, it will produce the link "https://en.wikipedia.org/wiki/fr:Article", but when you click it, you will go to the address "https://fr.wikipedia.org/wiki/Article".
  • To produce a link to the main page for a specific language, you skip the first two parameters. Leave them empty by typing three pipes in a row, following the syntax {{wp|(empty)|(empty)|3}}. The template will output the link with the link text "Wikipedia (lang. code)".
Example: to create a link to the main page for French Wikipedia, you type {{wp|||fr}}. The result will be a link with the link text "Wikipedia (fr)".
Usage
  • {{wp|1|2|3}}

Examples

Example case What you write What you see
Simplest use {{wp}} Wikipedia (en)
Article name {{wp|Mozilla Foundation}} Mozilla Foundation
Custom link text {{wp|Mozilla Foundation|Mozilla on Wikipedia}} Mozilla on Wikipedia
English is the default language {{wp|Mozilla Foundation}} Mozilla Foundation
Choose language: French {{wp|Mozilla Foundation||fr}} Mozilla Foundation
Main Page: Swedish {{wp|||sv}} Wikipedia (sv)
{{wp|Main Page||sv}} Main Page
{{wp|Huvudsida||sv}} Huvudsida

See also

  • {{wikipedia}}: simple template for creating a link to English Wikipedia, based on the page name.