Template:Wn/si/වි
{{Wn/si/වි}} | ||||
---|---|---|---|---|
non-local links 14 |
local links 3 |
forced links 2 | ||
recent articles | ||||
|
This template generates a conditional link — either to a local target if it exists, or to (ordinarily) Wikipedia if the local target does not exist.
භාවිතය
[edit source]Optional named parameter anchor
links to a specific section of a Wikipedia page, and does not attempt to autodetect a local target. It should be rarely used; eliminating template calls that use it requires idiosyncratic remedies.
උදාහරණය
[edit source]Code | Result | Note |
---|---|---|
{{Wn/si/වි|අප්රිකාව}}
|
අප්රිකාව | links to the local category (Category:Wn/si/අප්රිකාව), because it does exist. |
{{Wn/si/වි|ඕස්ට්රේලියාව|ඕස්ට්රේලියානුවෝ}}
|
ඕස්ට්රේලියානුවෝ | links to the local category (Category:Wn/si/ඕස්ට්රේලියාව), because it does exist. |
{{Wn/si/වි|Department of Immigration and Border Protection}}
|
Department of Immigration and Border Protection | links to the Wikipedia article, because a local category (Category:Wn/si/Department of Immigration and Border Protection) does not exist (as of this writing, anyway; if it gets created someday, we'll need a different example here). |
ඉවත් කිරීම
[edit source]Exercise care when removing calls to this template from a page: it is used, in part, to keep track of page categorization.
- If the local target doesn't exist, you probably shouldn't be removing the template call.
- If the local target does exist, consider whether the calling page should belong to some category associated with the local target, and if it should belong but doesn't, add it to that category. Then eliminate the locally linking template call by changing
{{Wn/si/වි|...}}
to[[...]]
.
This template populates three hidden categories: when linking to Wikipedia (without an anchor), it adds the calling page to Category:Wn/si/Pages with defaulting non-local links; when linking to the local target, it adds the calling page to Category:Wn/si/Pages with categorizable local links; when linking to Wikipedia with an anchor, it adds the calling page to Category:Wn/si/Pages with forced foreign links.
A gadget is provided to complement this template, "Underline in green categorizable {{Wn/si/වි}} links". The gadget also puts a dashed underline on forced foreign {{Wn/si/වි}} links.
අනෙකුත් පැරාමිති
[edit source]Optional parameter nocat
can be set to any non-blank value to suppress categorization of the calling page based on this template call.
Optional parameter foreign
can be set to either of two values to cause specialized effects. This optional parameter is ignored if anchor
is used.
foreign=force
links to Wikipedia, without checking for a local target. Categorizes to Category:Wn/si/Pages with forced foreign links.foreign=suppress
behaves as usual for local links, but if the link would be to Wikipedia, the label is unlinked. Does not affect categorization, which is still to Category:Wn/si/Pages with defaulting non-local links.
Optional parameter sister
can be set to the wikilink prefix of a sister other than Wikipedia, to override Wikipedia as the choice of non-local target when wikilinking non-locally. It has no effect on whether a non-local wikilink is provided, only on the target when used. Omit the trailing ":" from the prefix. For example, {{Wn/si/වි|Somalia|sister=wikt|foreign=force}}
would link to wikt:Somalia. There's a table of the prefixes for various sisters at meta. For non-English languages, use the sister prefix, a colon, and the language code; for example, {{Wn/si/වි|sister=w:fr|Souhail Alouini}}
would link to Souhail Alouini (as of this writing, Souhail Alouini has no local target and no en.wp target).
මේවාත් බලන්න
[edit source]- {{Wn/si/wikt}}
TemplateData
[edit source]A template to generate a conditional link - link to a local target if it exists, else link to Wikipedia.
Parameter | Description | Type | Status | |
---|---|---|---|---|
target | 1 | Page to link to | String | required |
label | 2 | Text to display instead of the target link | String | optional |
anchor | anchor | Link to a specific section of a Wikipedia page | String | optional |
ඉහත දැක්වෙන උපදෙස්, Template:Wn/si/වි/උපදෙස් වෙතින් ගෙනැවිත් ඇත. (සංස්කරණය | ඉතිහාසය) සංස්කාරක වරුන් හට මෙම සැකිල්ලේ වැලිපිල්ල (නිර්මාණය | mirror) සහ testcases (නිර්මාණය) පිටු තුළ අත්හදා බැලීම් සිදු කළ හැකිය. කරුණාකර /උපදෙස් උප පිටුව තුළට ප්රවර්ග එක් කරන්න. මෙම සැකිල්ලේ උප පිටු. |