Template:Chembox: Difference between revisions

From WikiMD's Wellness Encyclopedia

No edit summary
Tag: Manual revert
No edit summary
Line 1: Line 1:
<templatestyles src="Chembox/styles.css"/>
<templatestyles src="Chembox/styles.css"/>
{| class="infobox" style="width:22em; background:#f9f9f9; border:1px solid #aaa; padding:5px; font-size:90%;"
{| class="infobox" style="width:22em; background:#f9f9f9; border:1px solid #aaa; padding:5px; font-size:90%;"
|+ style="font-weight:bold; font-size:110%; background:#efefef; padding:3px;" | {{{name|{{PAGENAME}}}}}
|+ style="font-weight:bold; font-size:110%; background:#efefef; padding:3px;" | {{{Name|{{PAGENAME}}}}}


<!-- IMAGE SECTION -->
<!-- IMAGES -->
{{#if: {{{ImageFile|}}} |
|-
|-
| style="text-align:center;" | {{#if: {{{image|}}} |
| style="text-align:center;" | [[File:{{{ImageFile}}}|{{{ImageSize|200px}}}|alt={{{ImageAlt|}}}]]
[[File:{{{image}}}|{{{image_size|200px}}}|alt={{{image_alt|}}}]]<br>
<br><small>{{{ImageCaption|}}}</small>
<small>{{{image_alt|}}}</small>
}}
}}
{{#if: {{{image2|}}} |
{{#if: {{{ImageFile1|}}} |
<br>[[File:{{{image2}}}|{{{image2_size|200px}}}|alt={{{image2_alt|}}}]]<br>
|-
<small>{{{image2_alt|}}}</small>
| style="text-align:center;" | [[File:{{{ImageFile1}}}|{{{ImageSize1|200px}}}|alt={{{ImageAlt1|}}}]]
<br><small>{{{ImageCaption1|}}}</small>
}}
}}


<!-- IUPAC NAME -->
<!-- IDENTIFIERS -->
{{#if: {{{IUPACName|}}} |
|-
|-
| style="background:#efefef;" | IUPAC Name
| style="background:#efefef;" | IUPAC Name
| {{{IUPAC_name|}}}
| {{{IUPACName}}}
 
}}
<!-- OTHER NAMES -->
{{#if: {{{OtherNames|}}} |
{{#if: {{{other_names|}}} |
|-
|-
| style="background:#efefef;" | Other Names
| style="background:#efefef;" | Other Names
| {{{other_names}}}
| {{{OtherNames}}}
}}
}}


<!-- IDENTIFIERS -->
<!-- SECTION 1: IDENTIFIERS -->
{{#if: {{{CAS_number|}}} |
{{#if: {{{Section1|}}} |
|-
| style="background:#efefef;" | CAS Number
| {{{CAS_number}}}
}}
{{#if: {{{PubChem|}}} |
|-
| style="background:#efefef;" | PubChem
| [https://pubchem.ncbi.nlm.nih.gov/compound/{{{PubChem}}} {{{PubChem}}}]
}}
{{#if: {{{ChemSpiderID|}}} |
|-
| style="background:#efefef;" | ChemSpider
| [https://www.chemspider.com/Chemical-Structure.{{{ChemSpiderID}}}.html {{{ChemSpiderID}}}]
}}
{{#if: {{{UNII|}}} |
|-
| style="background:#efefef;" | UNII
| {{{UNII}}}
}}
{{#if: {{{ChEBI|}}} |
|-
| style="background:#efefef;" | ChEBI
| [https://www.ebi.ac.uk/chebi/searchId.do?chebiId=CHEBI:{{{ChEBI}}} {{{ChEBI}}}]
}}
{{#if: {{{ChEMBL|}}} |
|-
| style="background:#efefef;" | ChEMBL
| [https://www.ebi.ac.uk/chembl/compound_report_card/{{{ChEMBL}}}/ {{{ChEMBL}}}]
}}
{{#if: {{{IUPHAR_ligand|}}} |
|-
| style="background:#efefef;" | IUPHAR Ligand
| [https://www.guidetopharmacology.org/GRAC/LigandDisplayForward?ligandId={{{IUPHAR_ligand}}} {{{IUPHAR_ligand}}}]
}}
{{#if: {{{KEGG|}}} |
|-
|-
| style="background:#efefef;" | KEGG
| colspan="2" style="background:#d9edf7; text-align:center; font-weight:bold;" | Identifiers
| [https://www.genome.jp/dbget-bin/www_bget?cpd:{{{KEGG}}} {{{KEGG}}}]
}}
{{#if: {{{DrugBank|}}} |
|-
|-
| style="background:#efefef;" | DrugBank
| colspan="2" style="padding:5px;" | {{{Section1}}}
| [https://go.drugbank.com/drugs/{{{DrugBank}}} {{{DrugBank}}}]
}}
}}


<!-- CHEMICAL FORMULA -->
<!-- SECTION 2: PROPERTIES -->
{{#if: {{{Section2|}}} |
|-
|-
| style="background:#efefef;" | Chemical Formula
| colspan="2" style="background:#d9edf7; text-align:center; font-weight:bold;" | Properties
| {{{formula|}}}
 
<!-- MOLAR MASS -->
|-
|-
| style="background:#efefef;" | Molar Mass
| colspan="2" style="padding:5px;" | {{{Section2}}}
| {{{molar_mass|}}}
 
<!-- MELTING POINT -->
{{#if: {{{melting_point|}}} |
|-
| style="background:#efefef;" | Melting Point
| {{{melting_point}}}
}}
}}


<!-- SMILES -->
<!-- SECTION 3: HAZARDS -->
{{#if: {{{SMILES|}}} |
{{#if: {{{Section3|}}} |
|-
|-
| style="background:#efefef;" | SMILES
| colspan="2" style="background:#d9534f; color:#fff; text-align:center; font-weight:bold;" | Hazards
| {{{SMILES}}}
}}
 
<!-- InChI -->
{{#if: {{{InChI|}}} |
|-
| style="background:#efefef;" | InChI
| {{{InChI}}}
}}
 
<!-- InChIKey -->
{{#if: {{{InChIKey|}}} |
|-
|-
| style="background:#efefef;" | InChIKey
| colspan="2" style="padding:5px;" | {{{Section3}}}
| {{{InChIKey}}}
}}
}}


<!-- FOOTER -->
|-
|-
| style="text-align:center; font-size:85%; padding:5px;" colspan="2" |
| colspan="2" style="text-align:center; font-size:85%; padding:5px;" | <small>Data sourced from verified databases</small>
<small>Data sourced from verified databases</small>
|}
|}
<noinclude>
<noinclude>
== Usage ==
== Usage ==
This is a non-Lua version of the `Chembox` template for displaying chemical compound data in an infobox.
This template displays chemical information in a clean infobox.


=== Example ===
=== Example ===
<syntaxhighlight lang="mediawiki">
<syntaxhighlight lang="mediawiki">
{{Chembox
{{Chembox
| name          = Cholic acid
| Name        = Flavopiridol
| image        = Cholic acid.svg
| ImageFile  = Flavopiridol.svg
| image_alt    = Skeletal formula of cholic acid
| ImageSize  = 200px
| image2        = Cholic acid 3D ball.png
| ImageFile1  = Alvocidib ball-and-stick.png
| image2_alt    = Ball-and-stick model of cholic acid molecule
| ImageSize1  = 200px
| IUPAC_name    = (R)-4-[(3R,5S,7R,8R,9S,10R,12S,13R,14S,17R)-3,7,12-trihydroxy-10,13-dimethyl-1,2,3,4,5,6,7,8,9,11,12,14,15,16,17-tetradecahydrocyclopenta[a]phenanthren-17-yl]pentanoic acid
| IUPACName  = 2-(2-chlorophenyl)-5,7-dihydroxy-8-[(3S,4R)-3-hydroxy-1-methyl-4-piperidinyl]-4-chromenone
| other_names  = ,,12α-Trihydroxy-5β-cholan-24-oic acid
| OtherNames  = Flavopiridol, HMR 1275, L-868275
| CAS_number   = 81-25-4
 
| PubChem      = 221493
| Section1   = {{Chembox Identifiers
| ChemSpiderID  = 192104
| UNII = 45AD6X575G
| UNII          = G0S7T6QH5O
| CASNo = 146426-40-6
| ChEBI         = 16359
| PubChem = 5287969
| ChEMBL       = 1201632
| ChEBI = 47344
| IUPHAR_ligand = 609
| ChEMBL = 428690
| KEGG         = C05436
| ChemSpiderID = 4450222
| DrugBank     = DB02659
| KEGG = D09868
| formula      = C<sub>24</sub>H<sub>40</sub>O<sub>5</sub>
| StdInChI = 1S/C21H20ClNO5/...
| molar_mass    = 408.57 g/mol
| DrugBank = DB03496
| melting_point = 198-200 °C
| SMILES = Clc4ccccc4C=2Oc1c(c(O)cc(O)c1...)
| SMILES        = C[C@H]1CC[C@H]2[C@@H]3CC[C@H]4[C@@H](C[C@@H](O)[C@H]4[C@@H]3CC[C@H]2[C@@]1(C)C)C[C@@H](CC(=O)O)O
}}
| InChI        = 1S/C24H40O5/c1-13-4-5-14-15-6-7-17-20(27)18(15)8-9-21(17)24(14,2)16(13)10-19(26)22(3)11-23(28)12-25/h13-22,25-28H,4-12H2,1-3H3/t13-,14-,15+,16-,17-,18-,19-,20-,21-,22-,24-/m0/s1
 
| InChIKey      = BHQCQFFYRZLCQQ-HPLJOQBZSA-N
| Section2    = {{Chembox Properties
| Formula = C<sub>21</sub>H<sub>20</sub>ClNO<sub>5</sub>
| MolarMass = 401.8402
}}
 
| Section3    = {{Chembox Hazards
| MainHazards =  
}}
}}
}}
</syntaxhighlight>
</syntaxhighlight>


=== Parameters ===
=== Parameters ===
* `name` - Name of the compound.
* `Name` - Title displayed in the infobox header.
* `image` / `image2` - Image file names.
* `ImageFile`, `ImageFile1` - Chemical structure or other images.
* `image_alt` / `image2_alt` - Alternative text for images.
* `ImageSize` - Image size (default 200px).
* `IUPAC_name` - IUPAC-approved name.
* `IUPACName` - Official IUPAC name.
* `other_names` - Other names or synonyms.
* `OtherNames` - Alternate names.
* `CAS_number`, `PubChem`, `ChemSpiderID`, `UNII`, `ChEBI`, `ChEMBL`, `IUPHAR_ligand`, `KEGG`, `DrugBank` - Database identifiers.
* `Section1` - Identifier section using `Chembox Identifiers`.
* `formula` - Chemical formula.
* `Section2` - Properties section using `Chembox Properties`.
* `molar_mass` - Molar mass of the compound.
* `Section3` - Hazards section using `Chembox Hazards`.
* `melting_point` - Melting point.
* `SMILES`, `InChI`, `InChIKey` - Chemical notations.


== Notes ==
== Notes ==
* This template uses standard MediaWiki parser functions.
* Sections like `Section1`, `Section2`, and `Section3` are optional.
* Empty parameters are automatically hidden for clean display.
* Add as many sections as needed for chemical data.
 
</noinclude>
</noinclude>

Revision as of 17:59, 17 December 2024

Page Template:Chembox/styles.css has no content.

Chembox - - - - - - -
Data sourced from verified databases

Usage

This template displays chemical information in a clean infobox.

Example

{{Chembox
| Name        = Flavopiridol
| ImageFile   = Flavopiridol.svg
| ImageSize   = 200px
| ImageFile1  = Alvocidib ball-and-stick.png
| ImageSize1  = 200px
| IUPACName   = 2-(2-chlorophenyl)-5,7-dihydroxy-8-[(3S,4R)-3-hydroxy-1-methyl-4-piperidinyl]-4-chromenone
| OtherNames  = Flavopiridol, HMR 1275, L-868275

| Section1    = {{Chembox Identifiers
| UNII = 45AD6X575G
| CASNo = 146426-40-6
| PubChem = 5287969
| ChEBI = 47344
| ChEMBL = 428690
| ChemSpiderID = 4450222
| KEGG = D09868
| StdInChI = 1S/C21H20ClNO5/...
| DrugBank = DB03496
| SMILES = Clc4ccccc4C=2Oc1c(c(O)cc(O)c1...)
}}

| Section2    = {{Chembox Properties
| Formula = C<sub>21</sub>H<sub>20</sub>ClNO<sub>5</sub>
| MolarMass = 401.8402
}}

| Section3    = {{Chembox Hazards
| MainHazards = 
}}
}}

Parameters

  • `Name` - Title displayed in the infobox header.
  • `ImageFile`, `ImageFile1` - Chemical structure or other images.
  • `ImageSize` - Image size (default 200px).
  • `IUPACName` - Official IUPAC name.
  • `OtherNames` - Alternate names.
  • `Section1` - Identifier section using `Chembox Identifiers`.
  • `Section2` - Properties section using `Chembox Properties`.
  • `Section3` - Hazards section using `Chembox Hazards`.

Notes

  • Sections like `Section1`, `Section2`, and `Section3` are optional.
  • Add as many sections as needed for chemical data.