Template:WikipediaLink: Difference between revisions
(fix extra line (hopefully)) |
mNo edit summary |
||
(33 intermediate revisions by 4 users not shown) | |||
Line 1: | Line 1: | ||
View [[wikipedia: | <includeonly><p>{{#if:{{{lang|}}} | ||
|View the {{LangName|{{{lang}}}}} Wikipedia article on [[wikipedia:{{{lang}}}:{{{1|{{PAGENAME}}}}}|{{{2|{{PAGENAME}}}}}]]. (<small>[https://{{{lang}}}-m-wikipedia-org.translate.goog/wiki/{{#sub:{{localurl:{{{1|{{PAGENAME}}}}}}}|16}}?_x_tr_sl={{{lang}}}&_x_tr_tl=en&_x_tr_hl=en-US English translation] by Google</small>) {{#ifeq:{{NAMESPACE}}|Template||[[Category:{{LangName|{{{lang}}}}} Wikipedia links]]}} | |||
|View the Wikipedia article on [[wikipedia:{{{1|{{PAGENAME}}}}}|{{{2|{{PAGENAME}}}}}]]. {{#ifeq:{{NAMESPACE}}|Template||[[Category:English Wikipedia links]]}} | |||
}}</p></includeonly><noinclude> | |||
{{prot-temp}} | |||
{{Doc|text= | |||
This template creates a link from a CPDL page to a related article on Wikipedia. It is optimized for biography articles (composers, lyricists etc.) but can be used on other pages too. | |||
===Syntax=== | |||
{{tl|WikipediaLink|1{{=}}<article title on WP>|2{{=}}<text to be displayed on the link>|lang{{=}}<2-digit language code>}} | |||
:or, without numbered parameters: | |||
{{tl|WikipediaLink|<article title on WP>|<text to be displayed on the link>|lang{{=}}<2-digit language code>}} | |||
Note that all parameters are optional: | |||
*{{para|1}} is necessary only when the Wikipedia article's title is different from the title on CPDL. If not specified, the CPDL's page title will be used instead. | |||
*{{para|2}} is used to customize the link text. If not specified, the CPDL's page title will be used instead. It should be specified if the Wikipedia page has a title different from CPDL's page – even slightly different. | |||
*{{para|lang}} is useful when there isn't an article on the English Wikipedia yet, but a Wikipedia article is available in another language. <!--Besides linking to the Wikipedia article, it also offers a Google Translation of that article into English.--> | |||
===Examples=== | |||
{{tl|WikipediaLink}} | |||
:on [[Johann Sebastian Bach]]'s page will produce: | |||
{{WikipediaLink|Johann Sebastian Bach|Johann Sebastian Bach}} | |||
{{tl|WikipediaLink|William Smith (composer)}} | |||
:on [[William Smith]]'s page will produce: | |||
{{WikipediaLink|William Smith (composer)|William Smith}} | |||
:Notice that, had the first parameter not been supplied, the link would point to {{w|William Smith}}, which is a Wikipedia disambiguation page. | |||
{{tl|WikipediaLink|Erlkönig (Goethe)|Der Erlkönig}} | |||
:on [[Drei Goethe-Lieder (Huub de Lange)]]'s page will produce: | |||
{{WikipediaLink|Erlkönig (Goethe)|Der Erlkönig}} | |||
{{tl|WikipediaLink|Franz Xaver Engelhart|lang{{=}}de}} | |||
:on [[Franz Xaver Engelhart]]'s page will produce: | |||
{{WikipediaLink|Franz Xaver Engelhart|Franz Xaver Engelhart|lang=de}} | |||
===Categorization=== | |||
The page is categorized according to the language of the Wikipedia article: {{CiteCat|English Wikipedia links}}, {{CiteCat|French Wikipedia links}} etc. | |||
===See also=== | |||
*[[Template:W]] for in-line links to Wikipedia | |||
}} | |||
[[Category:External link templates]]</noinclude> |
Latest revision as of 18:29, 4 January 2022
This high-risk template has been protected from editing to prevent vandalism. Please use the talk page to ask an administrator about making an edit to change this template. |
This template creates a link from a CPDL page to a related article on Wikipedia. It is optimized for biography articles (composers, lyricists etc.) but can be used on other pages too.
Syntax
{{WikipediaLink|1=<article title on WP>|2=<text to be displayed on the link>|lang=<2-digit language code>}}
- or, without numbered parameters:
{{WikipediaLink|<article title on WP>|<text to be displayed on the link>|lang=<2-digit language code>}}
Note that all parameters are optional:
|1=
is necessary only when the Wikipedia article's title is different from the title on CPDL. If not specified, the CPDL's page title will be used instead.|2=
is used to customize the link text. If not specified, the CPDL's page title will be used instead. It should be specified if the Wikipedia page has a title different from CPDL's page – even slightly different.|lang=
is useful when there isn't an article on the English Wikipedia yet, but a Wikipedia article is available in another language.
Examples
{{WikipediaLink}}
- on Johann Sebastian Bach's page will produce:
View the Wikipedia article on Johann Sebastian Bach.
{{WikipediaLink|William Smith (composer)}}
- on William Smith's page will produce:
View the Wikipedia article on William Smith.
- Notice that, had the first parameter not been supplied, the link would point to William Smith, which is a Wikipedia disambiguation page.
{{WikipediaLink|Erlkönig (Goethe)|Der Erlkönig}}
- on Drei Goethe-Lieder (Huub de Lange)'s page will produce:
View the Wikipedia article on Der Erlkönig.
{{WikipediaLink|Franz Xaver Engelhart|lang=de}}
- on Franz Xaver Engelhart's page will produce:
View the German Wikipedia article on Franz Xaver Engelhart. (English translation by Google)
Categorization
The page is categorized according to the language of the Wikipedia article: English Wikipedia links, French Wikipedia links etc.
See also
- Template:W for in-line links to Wikipedia