Difference between revisions of "Template:Wikipedia"

From Second Life Wiki
Jump to navigation Jump to search
(The "on Wikipedia" trailing words became an alt to the Wikipedia icon (too confusing otherwise))
(The original code was designed for wikis with interwiki support, which is not the case on SL Wiki. This should fix the to Wikipedia.)
Line 1: Line 1:
{{#ifeq:{{{link|}}}|no
{{#ifeq:{{{icon|}}}|no
| {{#ifeq:{{{icon|}}}|no
   | <!--empty-->
   | <!--empty-->
   | <span style="white-space:nowrap"><!--prevent line wrap between the icon and the link text-->{{#ifeq:{{{text|}}}|no
   | [[File:Wikipedia-16px.png|16px|alt={{LangSwitch|lang={{#if:{{{lang|}}}|{{{lang|}}}|{{Langcode}}}}
    | <span style="padding:0 1px">[[File:Wikipedia-16px.png|alt=|link=|w:{{#if:{{{1|}}}|{{{1|}}}:}} {{{2<noinclude>|Article</noinclude>}}}]]</span>&nbsp;
  | ar = &#32;على ويكيبيديا
    | <!--empty-->
  | az = &#32;məqalə Vikipediya
    }}
  | bg = &#32;в Уикипедия
  }}<span style="white-space:normal"><!--allow line wraps between words of the link text, if needed--><bdi>{{#if:{{{3|<noinclude>optional label</noinclude>}}}
  | bn = &#32;উইকিপিডিয়ায়
  | {{{3|<noinclude>optional label</noinclude>}}}
  | br = &#32;ar Wikipedia
  | {{#ifeq:{{{text|}}}|no
  | bs = &#32;na Wikipediji
    | {{#ifeq:{{{icon|}}}|no
  | ca = &#32;a la Viquipèdia
      | w:{{#if:{{{1|}}}|{{{1|}}}:}}
  | co = &#32;supra Wikipedia
      }}
  | cs = &#32;na Wikipedii
    }}{{{2<noinclude>|Article</noinclude>}}}}}</bdi></span></span>
  | de = &#32;auf Wikipedia
| <span class="plainlinks" title="w:{{#if:{{{1|}}}|{{{1|}}}:}}{{{2<noinclude>|Article</noinclude>}}}">[{{FULLURL:w:{{#if:{{{1|}}}|{{{1|}}}:}}{{{2<noinclude>|Article</noinclude>}}}}} {{#ifeq:{{{icon|}}}|no
  | ee = &#32;kohta Wikipedia
  | <!--empty-->
  | el = &#32;στη Βικιπαίδεια
  | <span style="white-space:nowrap"><!--prevent line wrap between the icon and the link text-->{{#ifeq:{{{text|}}}|no
  | en = &#32;on Wikipedia
    | <span style="padding:0 1px">[[File:Wikipedia-16px.png|alt=|link=|w:{{#if:{{{1|}}}|{{{1|}}}:}}{{{2<noinclude>|Article</noinclude>}}}]]</span>&nbsp;
  | eo = &#32;ĉe Vikipedio
    | <!--empty-->
  | es = &#32;en la Wikipedia
    }}
  | eu = &#32;Wikipedian
  }}<span style="white-space:normal"><!--allow line wraps between words of the link text, if needed--><bdi>{{#if:{{{3|<noinclude>optional label</noinclude>}}}
  | fa = &#32;در ویکی‌پدیا
  | {{{3|<noinclude>optional label</noinclude>}}}
  | fi = &#32;Wikipediassa
  | {{{2<noinclude>|Article</noinclude>}}}
  | fr = &#32;sur Wikipédia
  }}</bdi></span></span>]</span>
  | he = &#32;בוויקיפדיה
}}{{#ifeq:{{{text|}}}|no
  | hi = &#32;विकिपीडिया पर
| <!--empty-->
  | hr = &#32;na Wikipediji
| &thinsp;[[File:Wikipedia-16px.png|16px|alt={{LangSwitch|lang={{#if:{{{lang|}}}|{{{lang|}}}|{{Langcode}}}}
  | hu = &#32;a Wikipédiában
  | ar = &#32;على ويكيبيديا
  | hy = &#32;Վիքիփեդիայում
  | az = &#32;məqalə Vikipediya
  | it = &#32;su Wikipedia
  | bg = &#32;в Уикипедия
  | ja = (Wikipedia)
  | bn = &#32;উইকিপিডিয়ায়
  | ka = &#32;ვიკიპედია
  | br = &#32;ar Wikipedia
  | km = &#32;លើវិគីភីឌា
  | bs = &#32;na Wikipediji
  | ko = (위키백과)
  | ca = &#32;a la Viquipèdia
  | lo = &#32;ກ່ຽວກັບວິກິພີເດຍ
  | co = &#32;supra Wikipedia
  | mk = &#32;на Википедија
  | cs = &#32;na Wikipedii
  | nl = &#32;op Wikipedia
  | de = &#32;auf Wikipedia
  | no = &#32;på Wikipedia
  | ee = &#32;kohta Wikipedia
  | pl = &#32;w Wikipedii
  | el = &#32;στη Βικιπαίδεια
  | pt = &#32;na Wikipédia
  | en = &#32;on Wikipedia
  | ru = &#32;в&nbsp;Википедии
  | eo = &#32;ĉe Vikipedio
  | sl = &#32;na Wikipediji
  | es = &#32;en la Wikipedia
  | sq = &#32;në Wikipedia
  | eu = &#32;Wikipedian
  | sr = &#32;на Википедиа
  | fa = &#32;در ویکی‌پدیا
  | tr = &#32;Vikipedi’de
  | fi = &#32;Wikipediassa
  | tl = &#32;sa Wikipedia
  | fr = &#32;sur Wikipédia
  | th = &#32;วิกิพีเดีย
  | he = &#32;בוויקיפדיה
  | uk = &#32;у Вікіпедії
  | hi = &#32;विकिपीडिया पर
  | ur = &#32;وکی پیڈیا پر
  | hr = &#32;na Wikipediji
  | yue = 喺維基百科
  | hu = &#32;a Wikipédiában
  | zh-hans = 于维基百科
  | hy = &#32;Վիքիփեդիայում
  | zh-hant = 於維基百科
  | it = &#32;su Wikipedia
  }}]]&nbsp;<!--
  | ja = (Wikipedia)
-->}}[https://{{#if:{{{lang|}}}|{{{lang|en}}}|{{Langcode|en}}}}.wikipedia.org/wiki/{{{1<noinclude>|Pagename</noinclude>}}}{{#if:{{{2}}}| {{{2<noinclude>|Display text</noinclude>}}}|<!--empty-->}}]<!--
  | ka = &#32;ვიკიპედია
--><noinclude><nowiki>{{Wikipedia|Pagename|display text|icon=no|lang=destination language (currently: </nowiki>{{{lang}}})<nowiki>}}</nowiki><!--
  | km = &#32;លើវិគីភីឌា
-->{{Documentation}}</noinclude>
  | 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 = 於維基百科
  }}]]
}}<noinclude>{{Documentation}}</noinclude>

Revision as of 16:29, 14 September 2022

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

[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=on Wikipedia LifeSecond Life |m1={{Wikipedia|lang=it|OpenStreetMap|OSM}}|r1=su Wikipedia [2]

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)