Mal:CheckElement
Template that returns an error message if the first argument is not valid for use with other nuclide templates helper templates.
Usage
uahWhen using a string that is not a valid element name or symbol or "x" or "element", an error message is returned, like so:
{{CheckElement|C}}
will return ""{{CheckElement|Karbon}}
will return ""{{CheckElement|Blablabla}}
will return "Datu Blablabla nénten wénten."
The "link=yes" argument is also supported; if the element name or symbol has no associated link, an error message is returned, like so:
{{CheckElement|link=yes|C}}
will return ""{{CheckElement|link=yes|Carbon}}
will return ""{{CheckElement|link=yes|X}}
will return "Datu generik 'X' nénten ngelah kaca antuk katautang."
When using a common name for an element that goes against the Wikipedia style guide for element names, a warning message will be returned. There are currently three such names:
{{CheckElement|Aluminum}}
will return "Aluminum nénten valid way to spell aluminium."{{CheckElement|Sulphur}}
will return "Sulphur nénten valid way to spell ."{{CheckElement|Cesium}}
will return "Cesium nénten valid way to spell caesium."
This template can be used in other templates to check for error before calling other templates that require a valid element or symbol like so:
{{#if:{{CheckElement|{{{element argument}}}|link={{{link|}}} }} | Error message (shown when the element is invalid). | Normal message (shown when the element is valid). }}
Tests
uahTemplate Data
uahTanpa pidarta.
Paraméter | Déskripsi | Soroh | Status | |
---|---|---|---|---|
1 | 1 | tanpa pidarta. | Nénten kauningin | dadi-dadi |
link | link | tanpa pidarta. | Nénten kauningin | dadi-dadi |
nocategory | nocategory | tanpa pidarta. | Nénten kauningin | dadi-dadi |
See also
uahThe above Dokumentasi is transcluded from Mal:CheckElement/doc. (obah | lelintihan) Editors can experiment in this template's sandbox (ngae | mirror) and testcases (ngae) pages. Please add categories to the /doc subpage. Subpages of this template. |