Difference between revisions of "Template:Chembox"

From WikiChem
Jump to: navigation, search
(Imported from http://en.wikipedia.org/w/index.php?title=Template:Chembox&oldid=307761069)
 
(code simplification (first step))
Line 1: Line 1:
<!--BetacommandBot Exclude--><includeonly><!--BetacommandBot Exclude--><!--Please do ''not'' subst this template. If you see this text in a document, the template 'chembox' has been substituted. In that case, please copy-and-paste the unsubstituted template from [[template:chembox]], move the data from here into that template, and remove the old template data. Thank you!
+
<includeonly><!--Please do ''not'' subst this template. If you see this text in a document, the template 'chembox' has been substituted. In that case, please copy-and-paste the unsubstituted template from [[template:chembox]], move the data from here into that template, and remove the old template data. Thank you!
-->{| class="infobox bordered" style="border-collapse: collapse; width: {{#if:{{{BoxWidth|}}}|{{{BoxWidth}}}|{{#if:{{{width|}}}|{{{width}}}|22em}} }}; font-size: 88%"
+
-->{| class="infobox bordered" style="border-collapse: collapse; width: {{{BoxWidth|{{{width|22em}}}}}}; font-size: 88%"
! colspan=2 style="background-color: #f8eaba; text-align: center; font-size: 125%" | {{#if:{{{Name|}}}|{{{Name}}}|{{PAGENAME}}}}{{#if:{{{Reference|}}}|{{{Reference}}} }}
+
! colspan=2 style="background-color: #f8eaba; text-align: center; font-size: 125%" | {{{Name|{{PAGENAME}}}}}{{{Reference|}}}
|-
+
|- <!--  
{{#if:{{{ImageFile|}}}{{{ImageFile1|}}}{{{ImageFile2|}}}{{{ImageFile3|}}}{{{ImageFileL1|}}}{{{ImageFileR1|}}}{{{ImageFileL2|}}}{{{ImageFileR2|}}}|
+
    IMAGE(S)
{{Chembox image|par_name={{#if:{{{ImageName|}}}|{{{ImageName}}} }} |par_value={{#if:{{{ImageFile|}}}|{{{ImageFile}}} }}|par_size={{px|{{{ImageSize|}}}|200px}} }}
+
    * if an image is specified
{{Chembox image|par_name={{#if:{{{ImageName1|}}}|{{{ImageName1}}} }} |par_value={{#if:{{{ImageFile1|}}}|{{{ImageFile1}}} }}|par_size={{px|{{{ImageSize1|}}}|200px}} }}
+
--> {{#if:{{{ImageFile|}}}{{{ImageFile1|}}}{{{ImageFile2|}}}{{{ImageFile3|}}}{{{ImageFileL1|}}}{{{ImageFileR1|}}}{{{ImageFileL2|}}}{{{ImageFileR2|}}}|
{{Chembox image sbs|par_nameL={{#if:{{{ImageNameL1|}}}|{{{ImageNameL1}}} }} |par_valueL={{#if:{{{ImageFileL1|}}}|{{{ImageFileL1}}} }}|par_sizeL={{px|{{{ImageSizeL1|}}}|100px}} | par_nameR={{#if:{{{ImageNameR1|}}}|{{{ImageNameR1}}} }} |par_valueR={{#if:{{{ImageFileR1|}}}|{{{ImageFileR1}}} }}|par_sizeR={{px|{{{ImageSizeR1|}}}|100px}} }}
+
{{Chembox image|par_name={{{ImageName|}}}|par_value={{{ImageFile|}}}|par_size={{px|{{{ImageSize|}}}|200px}} }}
{{Chembox image|par_name={{#if:{{{ImageName2|}}}|{{{ImageName2}}} }} |par_value={{#if:{{{ImageFile2|}}}|{{{ImageFile2}}} }}|par_size={{px|{{{ImageSize2|}}}|200px}} }}
+
{{Chembox image|par_name={{{ImageName1|}}}|par_value={{{ImageFile1|}}}|par_size={{px|{{{ImageSize1|}}}|200px}} }}
{{Chembox image|par_name={{#if:{{{ImageName3|}}}|{{{ImageName3}}} }} |par_value={{#if:{{{ImageFile3|}}}|{{{ImageFile3}}} }}|par_size={{px|{{{ImageSize3|}}}|200px}} }}
+
{{Chembox image sbs|par_nameL={{{ImageNameL1|}}}|par_valueL={{{ImageFileL1|}}}|par_sizeL={{px|{{{ImageSizeL1|}}}|100px}} | par_nameR={{{ImageNameR1|}}}|par_valueR={{{ImageFileR1|}}}|par_sizeR={{px|{{{ImageSizeR1|}}}|100px}} }}
{{Chembox image sbs|par_nameL={{#if:{{{ImageNameL2|}}}|{{{ImageNameL2}}} }} |par_valueL={{#if:{{{ImageFileL2|}}}|{{{ImageFileL2}}} }}|par_sizeL={{px|{{{ImageSizeL2|}}}|100px}} | par_nameR={{#if:{{{ImageNameR2|}}}|{{{ImageNameR2}}} }} |par_valueR={{#if:{{{ImageFileR2|}}}|{{{ImageFileR2}}} }}|par_sizeR={{px|{{{ImageSizeR2|}}}|100px}} }} |  
+
{{Chembox image|par_name={{{ImageName2|}}}|par_value={{{ImageFile2|}}}|par_size={{px|{{{ImageSize2|}}}|200px}} }}
 +
{{Chembox image|par_name={{{ImageName3|}}}|par_value={{{ImageFile3|}}}|par_size={{px|{{{ImageSize3|}}}|200px}} }}
 +
{{Chembox image sbs|par_nameL={{{ImageNameL2|}}}|par_valueL={{{ImageFileL2|}}}|par_sizeL={{px|{{{ImageSizeL2|}}}|100px}} | par_nameR={{{ImageNameR2|}}}|par_valueR={{{ImageFileR2|}}}|par_sizeR={{px|{{{ImageSizeR2|}}}|100px}} }} <!--
 +
    * if no image is specified, look for possible image
 +
-->|  
 
{{#ifexist:Image:{{PAGENAME}}.svg|{{Chembox image|par_name=ImageFile|par_value={{PAGENAME}}.svg|par_size={{px|{{{ImageSize|}}}|200px}} }} |
 
{{#ifexist:Image:{{PAGENAME}}.svg|{{Chembox image|par_name=ImageFile|par_value={{PAGENAME}}.svg|par_size={{px|{{{ImageSize|}}}|200px}} }} |
{{#ifexist:Image:{{PAGENAME}}.png|{{Chembox image|par_name=ImageFile|par_value={{PAGENAME}}.png|par_size={{px|{{{ImageSize|}}}|200px}} }} |  
+
{{#ifexist:Image:{{PAGENAME}}.png|{{Chembox image|par_name=ImageFile|par_value={{PAGENAME}}.png|par_size={{px|{{{ImageSize|}}}|200px}} }} |  
 
{{#ifexist:Image:{{PAGENAME}}.gif|{{Chembox image|par_name=ImageFile|par_value={{PAGENAME}}.gif|par_size={{px|{{{ImageSize|}}}|200px}} }} |  
 
{{#ifexist:Image:{{PAGENAME}}.gif|{{Chembox image|par_name=ImageFile|par_value={{PAGENAME}}.gif|par_size={{px|{{{ImageSize|}}}|200px}} }} |  
{{#ifexist:Image:{{PAGENAME}}.jpg|{{Chembox image|par_name=ImageFile|par_value={{PAGENAME}}.jpg|par_size={{px|{{{ImageSize|}}}|200px}} }} |  
+
{{#ifexist:Image:{{PAGENAME}}.jpg|{{Chembox image|par_name=ImageFile|par_value={{PAGENAME}}.jpg|par_size={{px|{{{ImageSize|}}}|200px}} }} <!--
 +
    * otherwise, add a cleanup category
 +
-->|  
 
{{#ifeq: {{NAMESPACE}} | {{ns:0}} | [[Category:Chemical pages needing a structure drawing]] }} }} }} }} }}
 
{{#ifeq: {{NAMESPACE}} | {{ns:0}} | [[Category:Chemical pages needing a structure drawing]] }} }} }} }} }}
}}
+
}} <!--
{{Chembox entry|par_name={{#if:{{{IUPACName|}}}|IUPACName }} |par_value={{#if:{{{IUPACName|}}}|{{{IUPACName}}} }} }}
+
    NON-MODULARIZED FIELDS (deprecated)
{{Chembox entry|par_name={{#if:{{{SystematicName|}}}|SystematicName }} |par_value={{#if:{{{SystematicName|}}}|{{{SystematicName}}} }} }}
+
-->{{Chembox entry|par_name={{#if:{{{IUPACName|}}}|IUPACName}}|par_value={{{IUPACName|}}} }}
{{Chembox entry|par_name={{#if:{{{OtherNames|}}}|OtherNames }} |par_value={{#if:{{{OtherNames|}}}|{{{OtherNames}}} }} }}
+
{{Chembox entry|par_name={{#if:{{{SystematicName|}}}|SystematicName}}|par_value={{{SystematicName|}}} }}
{{Chembox entry|par_name={{#if:{{{Abbreviations|}}}|Abbreviations }}|par_value={{#if:{{{Abbreviations|}}}|{{{Abbreviations}}} }} }}
+
{{Chembox entry|par_name={{#if:{{{OtherNames|}}}|OtherNames}}|par_value={{{OtherNames|}}} }}
{{Chembox entry|par_name={{#if:{{{Formula|}}}|Formula }} |par_value={{#if:{{{Formula|}}}|{{{Formula}}} }} }}
+
{{Chembox entry|par_name={{#if:{{{Abbreviations|}}}|Abbreviations}}|par_value={{{Abbreviations|}}} }}
{{Chembox entry|par_name={{#if:{{{MolarMass|}}}|MolarMass }} |par_value={{#if:{{{MolarMass|}}}|{{{MolarMass}}} }} }}
+
{{Chembox entry|par_name={{#if:{{{Formula|}}}|Formula}}|par_value={{{Formula|}}} }}
{{Chembox entry|par_name={{#if:{{{CASNo|}}}|CASNo }} |par_value={{#if:{{{CASNo|}}}|{{{CASNo}}} }} }}
+
{{Chembox entry|par_name={{#if:{{{MolarMass|}}}|MolarMass}}|par_value={{{MolarMass|}}} }}
{{Chembox entry|par_name={{#if:{{{Density|}}}|Density }} |par_value={{#if:{{{Density|}}}|{{{Density}}} }} }}
+
{{Chembox entry|par_name={{#if:{{{CASNo|}}}|CASNo }} |par_value={{{CASNo|}}} }}
{{Chembox entry|par_name={{#if:{{{Solubility|}}}|Solubility }} |par_value={{#if:{{{Solubility|}}}|{{{Solubility}}} }}|par_var_label={{#if:{{{Solvent|}}}|{{{Solvent}}} }} }}
+
{{Chembox entry|par_name={{#if:{{{Density|}}}|Density }} |par_value={{{Density|}}} }}
{{Chembox entry|par_name={{#if:{{{MeltingPt|}}}|MeltingPt }} |par_value={{#if:{{{MeltingPt|}}}|{{{MeltingPt}}} }} }}
+
{{Chembox entry|par_name={{#if:{{{Solubility|}}}|Solubility }} |par_value={{{Solubility|}}}|par_var_label={{{Solvent|}}} }}
{{Chembox entry|par_name={{#if:{{{BoilingPt|}}}|BoilingPt }} |par_value={{#if:{{{BoilingPt|}}}|{{{BoilingPt}}} }} }}
+
{{Chembox entry|par_name={{#if:{{{MeltingPt|}}}|MeltingPt }} |par_value={{{MeltingPt|}}} }}
{{Chembox entry|par_name={{#if:{{{LogP|}}}|LogP }} |par_value={{#if:{{{LogP|}}}|{{{LogP}}} }} }}
+
{{Chembox entry|par_name={{#if:{{{BoilingPt|}}}|BoilingPt }} |par_value={{{BoilingPt|}}} }}
{{Chembox entry|par_name={{#if:{{{VaporPressure|}}}|VaporPressure }}|par_value={{#if:{{{VaporPressure|}}}|{{{VaporPressure}}} }} }}
+
{{Chembox entry|par_name={{#if:{{{LogP|}}}|LogP }} |par_value={{{LogP|}}} }}
{{Chembox entry|par_name={{#if:{{{HenryConstant|}}}|HenryConstant }}|par_value={{#if:{{{HenryConstant|}}}|{{{HenryConstant}}} }} }}
+
{{Chembox entry|par_name={{#if:{{{VaporPressure|}}}|VaporPressure }}|par_value={{{VaporPressure|}}} }}
{{Chembox entry|par_name={{#if:{{{AtmosphericOHRateConstant|}}}|AtmosphericOHRateConstant }}|par_value={{#if:{{{AtmosphericOHRateConstant|}}}|{{{AtmosphericOHRateConstant}}} }} }}
+
{{Chembox entry|par_name={{#if:{{{HenryConstant|}}}|HenryConstant }}|par_value={{{HenryConstant|}}} }}
{{Chembox entry|par_name={{#if:{{{pKa|}}}|pKa }} |par_value={{#if:{{{pKa|}}}|{{{pKa}}} }} }}
+
{{Chembox entry|par_name={{#if:{{{AtmosphericOHRateConstant|}}}|AtmosphericOHRateConstant }}|par_value={{{AtmosphericOHRateConstant|}}} }}
{{Chembox entry|par_name={{#if:{{{pKb|}}}|pKb }} |par_value={{#if:{{{pKb|}}}|{{{pKb}}} }} }}
+
{{Chembox entry|par_name={{#if:{{{pKa|}}}|pKa }} |par_value={{{pKa|}}} }}
{{Chembox entry|par_name={{#if:{{{IsoelectricPt|}}}|IsoelectricPt }}|par_value={{#if:{{{IsoelectricPt|}}}|{{{IsoelectricPt}}} }} }}
+
{{Chembox entry|par_name={{#if:{{{pKb|}}}|pKb }} |par_value={{{pKb|}}} }}
{{Chembox entry|par_name={{#if:{{{DeltaHf|}}}|DeltaHf }} |par_value={{#if:{{{DeltaHf|}}}|{{{DeltaHf}}} }} }}
+
{{Chembox entry|par_name={{#if:{{{IsoelectricPt|}}}|IsoelectricPt }}|par_value={{{IsoelectricPt|}}} }}
{{Chembox entry|par_name={{#if:{{{DeltaHc|}}}|DeltaHc }} |par_value={{#if:{{{DeltaHc|}}}|{{{DeltaHc}}} }} }}
+
{{Chembox entry|par_name={{#if:{{{DeltaHf|}}}|DeltaHf }} |par_value={{{DeltaHf|}}} }}
{{Chembox entry|par_name={{#if:{{{EINECS|}}}|EINECS }} |par_value={{#if:{{{EINECS|}}}|{{{EINECS}}} }} }}
+
{{Chembox entry|par_name={{#if:{{{DeltaHc|}}}|DeltaHc }} |par_value={{{DeltaHc|}}} }}
{{Chembox entry|par_name={{#if:{{{EINECSCASNO|}}}|EINECSCASNO }} |par_value={{#if:{{{EINECSCASNO|}}}|{{{EINECSCASNO}}} }} }}
+
{{Chembox entry|par_name={{#if:{{{EINECS|}}}|EINECS }} |par_value={{{EINECS|}}} }}
{{Chembox entry|par_name={{#if:{{{PubChem|}}}|PubChem }} |par_value={{#if:{{{PubChem|}}}|{{{PubChem}}} }} }}
+
{{Chembox entry|par_name={{#if:{{{EINECSCASNO|}}}|EINECSCASNO }} |par_value={{{EINECSCASNO|}}} }}
{{Chembox entry|par_name={{#if:{{{SMILES|}}}|SMILES }} |par_value={{#if:{{{SMILES|}}}|{{{SMILES}}} }} }}
+
{{Chembox entry|par_name={{#if:{{{PubChem|}}}|PubChem }} |par_value={{{PubChem|}}} }}
{{Chembox entry|par_name={{#if:{{{InChI|}}}|InChI }} |par_value={{#if:{{{InChI|}}}|{{{InChI}}} }} }}
+
{{Chembox entry|par_name={{#if:{{{SMILES|}}}|SMILES }} |par_value={{{SMILES|}}} }}
 +
{{Chembox entry|par_name={{#if:{{{InChI|}}}|InChI }} |par_value={{{InChI|}}} }} <!--
 +
    * add cleanup category if template contains misplaced parameters
 +
-->{{#if:{{{Formula|}}}{{{MolarMass|}}}{{{CASNo|}}}{{{Density|}}}{{{Solubility|}}}{{{Solvent|}}}{{{MeltingPt|}}}{{{BoilingPt|}}}{{{LogP|}}}{{{VaporPressure|}}}{{{HenryConstant|}}}{{{AtmosphericOHRateConstant|}}}{{{pKa|}}}{{{pKb|}}}{{{IsoelectricPt|}}}{{{DeltaHf|}}}{{{DeltaHc|}}}{{{EINECS|}}}{{{EINECSCASNO|}}}{{{PubChem|}}}{{{SMILES|}}}{{{InChI|}}}|[[Category:Chemical infoboxes with misplaced or deprecated parameters]]}} <!--
 +
    MODULES -->
 
{{{Section1|}}}
 
{{{Section1|}}}
 
{{{Section2|}}}
 
{{{Section2|}}}
Line 56: Line 66:
 
{{{Section14|}}}
 
{{{Section14|}}}
 
{{{Section15|}}}
 
{{{Section15|}}}
{{#if:{{{Formula|}}}{{{MolarMass|}}}{{{CASNo|}}}{{{Density|}}}{{{Solubility|}}}{{{Solvent|}}}{{{MeltingPt|}}}{{{BoilingPt|}}}{{{LogP|}}}{{{VaporPressure|}}}{{{HenryConstant|}}}{{{AtmosphericOHRateConstant|}}}{{{pKa|}}}{{{pKb|}}}{{{IsoelectricPt|}}}{{{DeltaHf|}}}{{{DeltaHc|}}}{{{EINECS|}}}{{{EINECSCASNO|}}}{{{PubChem|}}}{{{SMILES|}}}{{{InChI|}}}|[[Category:Chemical infoboxes with misplaced or deprecated parameters]]}}
 
 
{{Chembox Supplement}}
 
{{Chembox Supplement}}
| colspan=2 style="background-color: #f8eaba; text-align: center" | {{#ifeq:{{{Verifiedfields|}}}|changed|&nbsp;{{cross|14}}[[Wikipedia:WikiProject_Chemicals/Chembox_validation|(what is this?)]]|{{#if:{{{verifiedrevid|}}}|&nbsp;{{tick|14}}[[Wikipedia:WikiProject_Chemicals/Chembox_validation|(what is this?)]]}}}}{{#if:{{{verifiedrevid|}}}|&nbsp;&nbsp;[http://en.wikipedia.org/w/index.php?&diff=cur&oldid={{{verifiedrevid|}}} (verify)]}}{{#ifeq:{{{Verifiedfields|}}}|changed|<br />|{{#if:{{{verifiedrevid|}}}|<br />}}}}{{#ifeq:{{{Verifiedfields|}}}|changed|[[Category:Chemboxes which contain changes to verified fields]]|}}{{#ifeq:{{{Watchedfields|}}}|changed|[[Category:Chemboxes which contain changes to watched fields]]|}}Except where noted otherwise, data are given for materials in their [[standard state|standard state (at 25&nbsp;°C, 100&nbsp;kPa)]]
+
<!-- VERIFICATION AND FOOTER -->
|-
+
| colspan=2 style="background-color: #f8eaba; text-align: center" | {{#ifeq:{{{Verifiedfields|}}}|changed|&nbsp;{{cross|14}}[[WikiChem:Validation of data in articles|(what is this?)]]|{{#if:{{{verifiedrevid|}}}|&nbsp;{{tick|14}}[[WikiChem:Validation of data in articles|(what is this?)]]}}}}{{#if:{{{verifiedrevid|}}}|&nbsp;&nbsp;[http://en.wikipedia.org/w/index.php?&diff=cur&oldid={{{verifiedrevid|}}} (verify)]}}{{#ifeq:{{{Verifiedfields|}}}|changed|<br />|{{#if:{{{verifiedrevid|}}}|<br />}}}}{{#ifeq:{{{Verifiedfields|}}}|changed|[[Category:Chemboxes which contain changes to verified fields]]|}}{{#ifeq:{{{Watchedfields|}}}|changed|[[Category:Chemboxes which contain changes to watched fields]]|}}Except where noted otherwise, data are given for materials in their [[standard state|standard state (at 25&nbsp;°C, 100&nbsp;kPa)]]
| colspan=2 style="text-align: center" | [[Wikipedia:Chemical infobox#References|Infobox references]]
 
 
|-
 
|-
 
|}</includeonly><noinclude>{{documentation}}</noinclude>
 
|}</includeonly><noinclude>{{documentation}}</noinclude>

Revision as of 18:47, 13 August 2009

[edit] [purge] Template-info-500px.png Template documentation

Usage

Parameters

Examples

See also

Error creating thumbnail: Unable to save thumbnail to destination
Wikipedia-logo.png This template was originally imported from Wikipedia, specifically this version of the template "Template:Chembox". Please see the history page on Wikipedia for the original authors. This WikiChem template may have been modified since it was imported. It is licensed under the Creative Commons Attribution–Share Alike 3.0 Unported license.