Difference between revisions of "Template:Wikipedia"

From Second Life Wiki
Jump to navigation Jump to search
(We're getting there...)
(Small adaptation, with urlencode, and attempt to give an error if {{{1}}} is not passed. This was tricky to get it right!)
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
{{#ifeq:{{{icon|}}}|no
{{#if:{{{1<noinclude>|Pagename</noinclude>}}}|
  | <!--empty-->
  {{#ifeq:{{{icon|}}}|no
  | [[File:Wikipedia-16px.png|16px|alt={{LangSwitch|lang={{#if:{{{lang|}}}|{{{lang|}}}|{{Langcode}}}}
    | <!--empty-->
  | ar = &#32;على ويكيبيديا
    | [[File:Wikipedia-16px.png|16px|alt="Wikipedia logo"]]&thinsp;<!--
  | az = &#32;məqalə Vikipediya
-->}}[https://{{#if:{{{lang|}}}|{{{lang|en}}}|{{Langcode|en}}}}.wikipedia.org/wiki/{{urlencode:{{{1}}}|WIKI}} {{{2|{{{1}}}}}}]<!--
  | bg = &#32;в Уикипедия
-->| {{error|1=Missing page name}}<!--
  | bn = &#32;উইকিপিডিয়ায়
-->}}<noinclude>
  | br = &#32;ar Wikipedia
<nowiki>{{Wikipedia|Pagename|display text|icon=no|lang=destination language (currently: </nowiki>{{Langcode|(unknown)}}<nowiki>)}}</nowiki><!--
  | bs = &#32;na Wikipediji
  | ca = &#32;a la Viquipèdia
  | co = &#32;supra Wikipedia
  | cs = &#32;na Wikipedii
  | de = &#32;auf Wikipedia
  | ee = &#32;kohta Wikipedia
  | el = &#32;στη Βικιπαίδεια
  | en = &#32;on Wikipedia
  | eo = &#32;ĉe Vikipedio
  | es = &#32;en la Wikipedia
  | eu = &#32;Wikipedian
  | fa = &#32;در ویکی‌پدیا
  | fi = &#32;Wikipediassa
  | fr = &#32;sur Wikipédia
  | he = &#32;בוויקיפדיה
  | hi = &#32;विकिपीडिया पर
  | hr = &#32;na Wikipediji
  | hu = &#32;a Wikipédiában
  | hy = &#32;Վիքիփեդիայում
  | it = &#32;su Wikipedia
  | ja = (Wikipedia)
  | ka = &#32;ვიკიპედია
  | km = &#32;លើវិគីភីឌា
  | ko = (위키백과)
  | lo = &#32;ກ່ຽວກັບວິກິພີເດຍ
  | mk = &#32;на Википедија
  | nl = &#32;op Wikipedia
  | no = &#32;på Wikipedia
  | pl = &#32;w Wikipedii
  | pt = &#32;na Wikipédia
  | ru = &#32;в&nbsp;Википедии
  | sl = &#32;na Wikipediji
  | sq = &#32;në Wikipedia
  | sr = &#32;на Википедиа
  | tr = &#32;Vikipedi’de
  | tl = &#32;sa Wikipedia
  | th = &#32;วิกิพีเดีย
  | uk = &#32;у Вікіпедії
  | ur = &#32;وکی پیڈیا پر
  | yue = 喺維基百科
  | zh-hans = 于维基百科
  | zh-hant = 於維基百科
  }}]]<nowiki> </nowiki><!--
-->}}[https://{{#if:{{{lang|}}}|{{{lang|en}}}|{{Langcode|en}}}}.wikipedia.org/wiki/{{{1<noinclude>|Pagename</noinclude>}}}{{#if:{{{2}}}|<nowiki> </nowiki>{{{2<noinclude>|Display text</noinclude>}}}|<!--empty-->}}]<!--
--><noinclude><nowiki>{{Wikipedia|Pagename|display text|icon=no|lang=destination language (currently: </nowiki>{{{lang}}})<nowiki>}}</nowiki><!--
-->{{Documentation}}</noinclude>
-->{{Documentation}}</noinclude>

Latest revision as of 19:32, 18 September 2022

"Wikipedia logo"{{{1}}}

{{Wikipedia|Pagename|display text|icon=no|lang=destination language (currently: en)}}

[Edit] [🔄Purge] Template-info.png Template documentation

exclamation mark

Note: This template is used on a lot of pages. In order not to put too much load on the servers, edits should be kept to a bare minimum.
Please discuss proposed changes on the talk page first.
Editing a template causes all pages that use the template to be re-rendered. If the Template is used often, this can put a lot of load on the servers since it fills up the job queue. [statistics]

This template is useful to simply create a link to Wikipedia.

Usage

  • First parameter (mandatory): the actual pagename on Wikipedia (or in the target wiki of the interwiki code specified in the first parameter)
    it is the Pagename in URL "//xx.wikipedia.org/wiki/Pagename");
    note however that this parameter should not be URL-encoded (with overlong %NN%NN sequences) but should readable (in native UTF-8), also preferably with spaces rather than underscores between words.
  • Second parameter: the text to display with the link. If unset, the template displays the title of the page (first parameter).

There are also three named parameters which define whether some parts of the link are shown:

  • lang: language for the destination page (default: current language)
  • icon: if set to no, the template doesn't display the Wikipedia icon;
    any other value (or if the parameter is not specified) will display this icon.

Examples

{{Markup2|m={{Wikipedia|Second Life|Second Life}}|r="Wikipedia logo"Second Life |m1={{Wikipedia|lang=it|OpenStreetMap|OSM}}|r1="Wikipedia logo" [https://it.wikipedia.org/wiki/OpenStreetMap OSM} ]

See also

  • The other, similar Template:WikiIcon, by default, does exactly what it says: draws an icon.
  • Template:Wiki does approximately the same thing as this template (may be merged in the future)