Template:WikipediaLink: Difference between revisions

From ChoralWiki
Jump to navigation Jump to search
No edit summary
(improved documentation in order to make it clearer (hopefully))
Line 1: Line 1:
<includeonly><p>{{#if:{{{lang|}}}
<includeonly><p>{{#if:{{{lang|}}}
|View the {{LangName|{{{lang}}}}} Wikipedia article on [[wikipedia:{{{lang}}}:{{{1|{{PAGENAME}}}}}|{{{2|{{PAGENAME}}}}}]]. (<small>[http://translate.google.com/translate?sl={{{lang}}}&tl=en&u={{urlencode:http://{{{lang}}}.wikipedia.org/wiki/{{{1|{{PAGENAME}}}}} }} English translation] by Google</small>) {{#ifeq:{{NAMESPACE}}|Template||[[Category:Non-English Wikipedia links|{{{lang}}}]]}}
|View the {{LangName|{{{lang}}}}} Wikipedia article on [[wikipedia:{{{lang}}}:{{{1|{{PAGENAME}}}}}|{{{2|{{PAGENAME}}}}}]]. (<small>[http://translate.google.com/translate?sl={{{lang}}}&tl=en&u={{urlencode:http://{{{lang}}}.wikipedia.org/wiki/{{{1|{{PAGENAME}}}}} }} English translation] by Google</small>) {{#ifeq:{{NAMESPACE}}|Template||[[Category:{{LangName|{{{lang}}}}} Wikipedia links|{{{lang}}}]]}}
|View the Wikipedia article on [[wikipedia:{{{1|{{PAGENAME}}}}}|{{{2|{{PAGENAME}}}}}]]. {{#ifeq:{{NAMESPACE}}|Template||[[Category:English Wikipedia links]]}}
|View the Wikipedia article on [[wikipedia:{{{1|{{PAGENAME}}}}}|{{{2|{{PAGENAME}}}}}]]. {{#ifeq:{{NAMESPACE}}|Template||[[Category:English Wikipedia links]]}}
}}</p></includeonly><noinclude>
}}</p></includeonly><noinclude>
{{prot-temp}}<br>
{{prot-temp}}
{{DisplayBox|title=Documentation|text=
{{Doc|text=
This template is used on composer and lyricist pages to output a link to the Wikipedia article for that individual. It may simply be used without any variables or, if the spelling of the page title of the Wikipedia article differs from the CPDL page, a single variable should be used to specify the Wikipedia article title. In this latter case the name displayed will be that of the page title instead of the variable informed.
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.


;Examples:
===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 informed, the CPDL's page title will be used instead.
*{{para|2}} is used to customize the link text. If not informed, the CPDL's page title will be used instead.
*{{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}}
{{tl|WikipediaLink}}
:which produces:
:on [[Johann Sebastian Bach]]'s page will produce:
{{WikipediaLink}}
{{WikipediaLink|Johann Sebastian Bach|Johann Sebastian Bach}}
 


{{tl|WikipediaLink|William Smith (composer)}}
{{tl|WikipediaLink|William Smith (composer)}}
:which produces:
:on [[William Smith]]'s page will produce:
{{WikipediaLink|William Smith (composer)}}
{{WikipediaLink|William Smith (composer)|William Smith}}
:Note that if the first parameter had not been informed, the link would point to {{w|William Smith}}, which is a Wikipedia disambiguation page.


{{tl|WikipediaLink|William Smith (composer)|William Smith}}
:which produces:
{{WikipediaLink|William Smith (composer)|William Smith}}


{{tl|WikipediaLink|Franz Xaver Engelhart|lang{{=}}de‎‎}}
{{tl|WikipediaLink|Erlkönig (Goethe)|Der Erlkönig}}
:which produces:
:on [[Drei Goethe-Lieder (Huub de Lange)]]'s page will produce:
{{WikipediaLink|Franz Xaver Engelhart|lang=de}}
{{WikipediaLink|Erlkönig (Goethe)|Der Erlkönig}}




;Categorization
{{tl|WikipediaLink|Franz Xaver Engelhart|lang{{=}}de‎‎}}
The page is categorized according to the language of the Wikipedia article: {{CiteCat|English Wikipedia links}} or {{CiteCat|Non-English Wikipedia links}}
: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
===See also===
*[[Template:W]] for in-line links to Wikipedia
*[[Template:W]] for in-line links to Wikipedia
}}
}}
[[Category:External link templates]]</noinclude>
[[Category:External link templates]]</noinclude>

Revision as of 23:19, 26 November 2020

Documentation

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 informed, the CPDL's page title will be used instead.
  • |2= is used to customize the link text. If not informed, the CPDL's page title will be used instead.
  • |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

{{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.

Note that if the first parameter had not been informed, the link would point to William SmithLink to the English Wikipedia article, 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