Difference between revisions of "Template:LinkForElement"
imported>SkyLined (Added symbols and generic "x" and "element". Added dots in error messages) |
imported>Hgrosser (link from incorrect spelling of element to correct one …using wikEd) |
||
| Line 7: | Line 7: | ||
|{{lc:{{{1}}}}}-{{{2}}}{{{3|}}} | |{{lc:{{{1}}}}}-{{{2}}}{{{3|}}} | ||
|{{#switch:{{lc:{{{1}}}}} | |{{#switch:{{lc:{{{1}}}}} | ||
| − | |||
| − | |||
| − | |||
| − | |||
| | | | ||
|x|element={{FormattingError|The generic element '{{{1}}}' does not have a page to link to.}} | |x|element={{FormattingError|The generic element '{{{1}}}' does not have a page to link to.}} | ||
| Line 29: | Line 25: | ||
|mg|magnesium=magnesium | |mg|magnesium=magnesium | ||
|al|aluminium=aluminium | |al|aluminium=aluminium | ||
| + | |al|aluminum=aluminium | ||
|si|silicon=silicon | |si|silicon=silicon | ||
|p|phosphorus=phosphorus | |p|phosphorus=phosphorus | ||
|s|sulfur=sulfur | |s|sulfur=sulfur | ||
| + | |s|sulphur=sulfur | ||
|cl|chlorine=chlorine | |cl|chlorine=chlorine | ||
|ar|argon=argon | |ar|argon=argon | ||
| Line 71: | Line 69: | ||
|xe|xenon=xenon | |xe|xenon=xenon | ||
|cs|caesium=caesium | |cs|caesium=caesium | ||
| + | |cs|cesium=caesium | ||
|ba|barium=barium | |ba|barium=barium | ||
|la|lanthanum=lanthanum | |la|lanthanum=lanthanum | ||
Revision as of 07:03, 17 December 2009
Template that returns the Wikipedia page for an element given its name or the Wikipedia page for an isotope given the element's name and its mass number.
Example usage
{{LinkForElement|Mercury}}will return "mercury (element)"{{LinkForElement|Uranium|238}}will return "uranium-238"
When using a common name for an element that goes against the Wikipedia style guide for element names, a warning message will inform the editor about this. There are currently three such names:
{{LinkForElement|Aluminum}}will return "aluminium"{{LinkForElement|Sulphur}}will return "sulfur"{{LinkForElement|Cesium}}will return "caesium"
Because the output of this script is expected to get used in a link and any error message this script outputs will also contain links, the error message will look corrupt. It is recommended that you use {{CheckElement}} to check that no error message will be output before using this template. If {{CheckElement}} returns an error message, you should output that error message instead.
See also
Template:Periodic table templates
| The above documentation is transcluded from Template:LinkForElement/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. |