Difference between revisions of "Template:CheckElement"
Jump to navigation
Jump to search
imported>Headbomb (fix) |
imported>Wbm1058 (Undid revision 848730348 by Wbm1058 (talk) never mind. that just replaces the error with errors in Template:ProtonsForElement and in Template:SymbolForElement. I'll just edit the archives.) |
||
| (31 intermediate revisions by 17 users not shown) | |||
| Line 1: | Line 1: | ||
| − | + | <includeonly>{{#switch:{{lc:{{{1}}} }} | |
| − | + | |x|element={{#ifeq:{{lc:{{{link|}}} }} |yes | |
| − | + | |{{#if:{{{nocategory|}}} | |[[Category:Pages with incorrect nuclide templates use]]}}{{Formatting error | |
| − | + | |The generic element '{{{1}}}' does not have a page to link to.|nocategory={{{nocategory|}}} }}<!-- | |
| − | + | -->}} | |
| − | + | |aluminum | |
| − | + | |sulphur | |
| − | + | |cesium={{#if:{{{nocategory|}}} | |[[Category:Pages with incorrect nuclide templates use]]}}<!-- | |
| − | + | -->{{Formatting error | |
| − | + | |{{{1}}} is not a [[Wikipedia:WikiProject Chemicals/Style guidelines#Element names|valid]]<!-- | |
| − | + | ||
| − | + | --> way to spell {{#switch:{{lc:{{{1}}} }} | |
| − | + | |aluminum=aluminium | |
| − | + | |sulphur=sulfur | |
| − | + | |cesium=caesium | |
| − | + | }}.|nocategory={{{nocategory|}}} }} | |
| − | + | |mu|muonium= | |
| − | + | |ps|positronium= | |
| − | + | |neutronium= | |
| − | + | |h|hydrogen= | |
| − | + | |d|deuterium= | |
| − | + | |t|tritium= | |
| − | + | |he|helium= | |
| − | + | |li|lithium= | |
| − | + | |be|beryllium= | |
| − | + | |b|boron= | |
| − | + | |c|carbon= | |
| − | + | |n|nitrogen= | |
| − | + | |o|oxygen= | |
| − | + | |f|fluorine= | |
| − | + | |ne|neon= | |
| − | + | |na|sodium= | |
| − | + | |mg|magnesium= | |
| − | + | |al|aluminium= | |
| − | + | |si|silicon= | |
| − | + | |p|phosphorus= | |
| − | + | |s|sulfur= | |
| − | + | |cl|chlorine= | |
| − | + | |ar|argon= | |
| − | + | |k|potassium= | |
| − | + | |ca|calcium= | |
| − | + | |sc|scandium= | |
| − | + | |ti|titanium= | |
| − | + | |v|vanadium= | |
| − | + | |cr|chromium= | |
| − | + | |mn|manganese= | |
| − | + | |fe|iron= | |
| − | + | |co|cobalt= | |
| − | + | |ni|nickel= | |
| − | + | |cu|copper= | |
| − | + | |zn|zinc= | |
| − | + | |ga|gallium= | |
| − | + | |ge|germanium= | |
| − | + | |as|arsenic= | |
| − | + | |se|selenium= | |
| − | + | |br|bromine= | |
| − | + | |kr|krypton= | |
| − | + | |rb|rubidium= | |
| − | + | |sr|strontium= | |
| − | + | |y|yttrium= | |
| − | + | |zr|zirconium= | |
| − | + | |nb|niobium= | |
| − | + | |mo|molybdenum= | |
| − | + | |tc|technetium= | |
| − | + | |ru|ruthenium= | |
| − | + | |rh|rhodium= | |
| − | + | |pd|palladium= | |
| − | + | |ag|silver= | |
| − | + | |cd|cadmium= | |
| − | + | |in|indium= | |
| − | + | |sn|tin= | |
| − | + | |sb|antimony= | |
| − | + | |te|tellurium= | |
| − | + | |i|iodine= | |
| − | + | |xe|xenon= | |
| − | + | |cs|caesium= | |
| − | + | |ba|barium= | |
| − | + | |la|lanthanum= | |
| − | + | |ce|cerium= | |
| − | + | |pr|praseodymium= | |
| − | + | |nd|neodymium= | |
| − | + | |pm|promethium= | |
| − | + | |sm|samarium= | |
| − | + | |eu|europium= | |
| − | + | |gd|gadolinium= | |
| − | + | |tb|terbium= | |
| − | + | |dy|dysprosium= | |
| − | + | |ho|holmium= | |
| − | + | |er|erbium= | |
| − | + | |tm|thulium= | |
| − | + | |yb|ytterbium= | |
| − | + | |lu|lutetium= | |
| − | + | |hf|hafnium= | |
| − | + | |ta|tantalum= | |
| − | + | |w|tungsten= | |
| − | + | |re|rhenium= | |
| − | + | |os|osmium= | |
| − | + | |ir|iridium= | |
| − | + | |pt|platinum= | |
| − | + | |au|gold= | |
| − | + | |hg|mercury= | |
| − | + | |tl|thallium= | |
| − | + | |pb|lead= | |
| − | + | |bi|bismuth= | |
| − | + | |po|polonium= | |
| − | + | |at|astatine= | |
| − | + | |rn|radon= | |
| − | + | |fr|francium= | |
| − | + | |ra|radium= | |
| − | + | |ac|actinium= | |
| − | + | |th|thorium= | |
| − | + | |pa|protactinium= | |
| − | + | |u|uranium= | |
| − | + | |np|neptunium= | |
| − | + | |pu|plutonium= | |
| − | + | |am|americium= | |
| − | + | |cm|curium= | |
| − | + | |bk|berkelium= | |
| − | + | |cf|californium= | |
| − | + | |es|einsteinium= | |
| − | + | |fm|fermium= | |
| − | + | |md|mendelevium= | |
| − | + | |no|nobelium= | |
| − | + | |lr|lawrencium= | |
| − | + | |rf|rutherfordium= | |
| − | + | |db|dubnium= | |
| − | + | |sg|seaborgium= | |
| − | + | |bh|bohrium= | |
| − | + | |hs|hassium= | |
| − | + | |mt|meitnerium= | |
| − | + | |ds|darmstadtium= | |
| − | + | |rg|roentgenium= | |
| − | + | |cn|copernicium= | |
| − | + | |nh|nihonium= | |
| − | + | |fl|flerovium= | |
| − | + | |mc|moscovium= | |
| − | + | |lv|livermorium= | |
| − | + | |ts|tennessine= | |
| − | + | |og|oganesson= | |
| − | + | <!-- 119 and higher: --> | |
| − | + | |uue|ununennium= | |
| − | + | |ubn|unbinilium= | |
| − | + | |ubu|unbiunium= | |
| − | + | |ubb|unbibium= | |
| − | + | |ubt|unbitrium= | |
| − | + | |ubq|unbiquadium= | |
| − | + | |ubp|unbipentium= | |
| − | + | |ubh|unbihexium= | |
| − | + | |ubs|unbiseptium= | |
| − | + | |#default = {{#if:{{{nocategory|}}}||[[Category:Pages with incorrect nuclide templates use]]}}{{Formatting error|nocategory={{{nocategory|}}}|The element {{{1}}} does not exist{{main other|1=[[Category:Chemical element unknown]]}}.}} | |
| − | + | }}</includeonly><noinclude>{{documentation}}</noinclude> | |
| − | |||
| − | }}</ | ||
Latest revision as of 22:39, 3 July 2018
Template that returns an error message if the first argument is not valid for use with other nuclide templates helper templates.
Usage
When 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|Carbon}}will return ""{{CheckElement|Blablabla}}will return "The element Blablabla does not exist."
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 "The generic element 'X' does not have a page to link to."
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 is not a valid way to spell aluminium."{{CheckElement|Sulphur}}will return "Sulphur is not a valid way to spell sulfur."{{CheckElement|Cesium}}will return "Cesium is not a 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).
}}
See also
Template:Periodic table templates
| The above documentation is transcluded from Template:CheckElement/doc. (edit | history) Editors can experiment in this template's sandbox (create | mirror) and testcases (create) pages. Please add categories to the /doc subpage. Subpages of this template. |