Difference between revisions of "Template:Wikipedia"

From Second Life Wiki
Jump to navigation Jump to search
(We're getting there...)
(Attempt to get valid links using the urlencode magic word)
Line 1: Line 1:
{{#ifeq:{{{icon|}}}|no
{{#ifeq:{{{icon|}}}|no
   | <!--empty-->
   | <!--empty-->
   | [[File:Wikipedia-16px.png|16px|alt={{LangSwitch|lang={{#if:{{{lang|}}}|{{{lang|}}}|{{Langcode}}}}
   | [[File:Wikipedia-16px.png|16px|alt="Wikipedia logo"]]<nowiki> </nowiki><!--
  | ar = &#32;على ويكيبيديا
-->}}[{{urlencode:https://{{#if:{{{lang|}}}|{{{lang|en}}}|{{Langcode|en}}}}.wikipedia.org/wiki/{{{1}}}|WIKI}} {{#if:{{{2}}}|{{{2}}}|<!--empty-->}}]<!--
  | az = &#32;məqalə Vikipediya
  | bg = &#32;в Уикипедия
  | bn = &#32;উইকিপিডিয়ায়
  | br = &#32;ar Wikipedia
  | 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><!--
--><noinclude><nowiki>{{Wikipedia|Pagename|display text|icon=no|lang=destination language (currently: </nowiki>{{{lang}}})<nowiki>}}</nowiki><!--
-->{{Documentation}}</noinclude>
-->{{Documentation}}</noinclude>

Revision as of 18:00, 18 September 2022

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

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

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" 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)