Difference between revisions of "Template:LinkForElement/doc"
imported>Frietjes (→See also: Removed sitelinks migrated to Wikidata) |
imported>GoingBatty m (General fixes, typo(s) fixed: wikipedia → Wikipedia (2) using AWB (11376)) |
||
| Line 1: | Line 1: | ||
{{Documentation subpage}} | {{Documentation subpage}} | ||
<!-- PLEASE ADD CATEGORIES AND INTERWIKIS AT THE BOTTOM OF THIS PAGE --> | <!-- PLEASE ADD CATEGORIES AND INTERWIKIS AT THE BOTTOM OF THIS PAGE --> | ||
| − | Template that returns the | + | 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 == | == Example usage == | ||
| Line 7: | Line 7: | ||
*<code><nowiki>{{LinkForElement|Uranium|238}}</nowiki></code> will return "{{LinkForElement|Uranium|238}}" | *<code><nowiki>{{LinkForElement|Uranium|238}}</nowiki></code> will return "{{LinkForElement|Uranium|238}}" | ||
| − | When using a common name for an element that goes against the [[Wikipedia:WikiProject Chemicals/Style guidelines# | + | When using a common name for an element that goes against the [[Wikipedia:WikiProject Chemicals/Style guidelines#Element names|Wikipedia style guide for element names]], a warning message will inform the editor about this. There are currently three such names: |
*<code><nowiki>{{LinkForElement|Aluminum}}</nowiki></code> will return "{{LinkForElement|Aluminum|nocategory=true}}" | *<code><nowiki>{{LinkForElement|Aluminum}}</nowiki></code> will return "{{LinkForElement|Aluminum|nocategory=true}}" | ||
*<code><nowiki>{{LinkForElement|Sulphur}}</nowiki></code> will return "{{LinkForElement|Sulphur|nocategory=true}}" | *<code><nowiki>{{LinkForElement|Sulphur}}</nowiki></code> will return "{{LinkForElement|Sulphur|nocategory=true}}" | ||
Revision as of 23:05, 5 September 2015
| 40px | This is a documentation subpage for Template:LinkForElement. It contains usage information, categories and other content that is not part of the original template page. |
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 "Aluminum is not a valid way to spell aluminium."{{LinkForElement|Sulphur}}will return "Sulphur is not a valid way to spell sulfur."{{LinkForElement|Cesium}}will return "Cesium is not a valid way to spell 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