Template:Chembox: Difference between revisions

From WikiMD's Wellness Encyclopedia

en>Snowmanonahoe
fix preview warning
No edit summary
Line 1: Line 1:
<templatestyles src="Chembox/styles.css"/>
<templatestyles src="Chembox/styles.css"/>
<!--Shortdesc at the end-->{|class="infobox ib-chembox" {{#if:{{{width|}}}{{{style|}}}|style="{{#if:{{{width|}}}|width:{{{width|}}};}} {{#if:{{{style|}}}|{{{style}}}}}"}}<!--
{| class="infobox ib-chembox" style="{{#if:{{{width|}}}|width:{{{width}}};}}{{#if:{{{style|}}}|{{{style}}}}}"
TITLE -->
|+ {{{Name|{{PAGENAME}}}}}{{{Reference|}}}{{{Chembox_ref|}}}
|+ {{#if:{{{Name|}}}|{{{Name|}}}|{{PAGENAME}}}}{{{Reference|}}}{{{Chembox_ref|}}}
 
|- <!-- IMAGES -->
<!-- IMAGE SECTION -->
{{#if:{{{ImageFile|}}}{{{ImageFile1|}}}{{{ImageFile2|}}}{{{ImageFile3|}}}{{{ImageFileL1|}}}{{{ImageFileR1|}}}{{{ImageFileL2|}}}{{{ImageFileR2|}}}<!-- rows 4/7 checked -->
{{#if: {{{ImageFile|}}}{{{ImageFile1|}}}{{{ImageFile2|}}} |
|<!-- Row 1/7 -->{{Chembox image
|-
|par_file={{{ImageFile|}}}
| style="text-align:center;" |
|par_title={{{ImageName|}}}
[[File:{{{ImageFile|}}}|{{{ImageSize|frameless}}}|alt={{{ImageAlt|}}}]]<br>
|par_size={{{ImageSize|}}}
{{#if: {{{ImageCaption|}}} | <small>{{{ImageCaption}}}</small> }}
|par_alt={{{ImageAlt|}}}
|par_caption={{{ImageCaption|}}}
|par_ref={{{ImageFile_Ref|}}}
|par_class={{{ImageClass|}}} }}
<!-- Row 2/7 -->{{Chembox image
|par_file={{{ImageFile1|}}}
|par_title={{{ImageName1|}}}
|par_size={{{ImageSize1|}}}
|par_alt={{{ImageAlt1|}}}
|par_caption={{{ImageCaption1|}}}
|par_ref={{{ImageFile1_Ref|}}}
|par_class={{{ImageClass1|}}} }}
<!-- Row 3/7 -->{{Chembox image sbs
|par_fileL={{{ImageFileL1|}}}
|par_titleL={{{ImageNameL1|}}}
|par_sizeL={{{ImageSizeL1|}}}
|par_altL={{{ImageAltL1|}}}
|par_captionL={{{ImageCaptionL1|}}}
|par_refL={{{ImageFileL1_Ref|}}}
|par_classL={{{ImageClassL1|}}}
|par_fileR={{{ImageFileR1|}}}
|par_titleR={{{ImageNameR1|}}}
|par_sizeR={{{ImageSizeR1|}}}
|par_altR={{{ImageAltR1|}}}
|par_captionR={{{ImageCaptionR1|}}}
|par_refR={{{ImageFileR1_Ref|}}}
|par_classR={{{ImageClassR1|}}}
|par_captionLR={{{ImageCaptionLR1|}}}}}<!-- new Nov 2017: caption for both images -->
<!-- Row 4/7 -->{{Chembox image
|par_file={{{ImageFile2|}}}
|par_title={{{ImageName2|}}}
|par_size={{{ImageSize2|}}}
|par_alt={{{ImageAlt2|}}}
|par_caption={{{ImageCaption2|}}}
|par_ref={{{ImageFile2_Ref|}}}
|par_class={{{ImageClass2|}}} }}
<!-- Row 5/7 -->{{Chembox image sbs
|par_fileL={{{ImageFileL2|}}}
|par_titleL={{{ImageNameL2|}}}
|par_sizeL={{{ImageSizeL2|}}}
|par_altL={{{ImageAltL2|}}}
|par_captionL={{{ImageCaptionL2|}}}
|par_refL={{{ImageFileL2_Ref|}}}
|par_classL={{{ImageClassL2|}}}
|par_fileR={{{ImageFileR2|}}}
|par_titleR={{{ImageNameR2|}}}
|par_sizeR={{{ImageSizeR2|}}}
|par_altR={{{ImageAltR2|}}}
|par_captionR={{{ImageCaptionR2|}}}
|par_refR={{{ImageFileR2_Ref|}}}
|par_classR={{{ImageClassR2|}}}
|par_captionLR={{{ImageCaptionLR2|}}} }}
<!-- Row 6/7 -->{{Chembox image
|par_file={{{ImageFile3|}}}
|par_title={{{ImageName3|}}}
|par_size={{{ImageSize3|}}}
|par_alt={{{ImageAlt3|}}}
|par_caption={{{ImageCaption3|}}}
|par_ref ={{{ImageFile3_Ref|}}}  
|par_class={{{ImageClass3|}}} }}
<!-- Row 7/7 -->{{Chembox image sbs
|par_fileL={{{ImageFileL3|}}}
|par_titleL={{{ImageNameL3|}}}
|par_sizeL={{{ImageSizeL3|}}}
|par_altL={{{ImageAltL3|}}}
|par_captionL={{{ImageCaptionL3|}}}
|par_refL={{{ImageFileL3_Ref|}}}
|par_classL={{{ImageClassL3|}}}
|par_fileR={{{ImageFileR3|}}}
|par_titleR={{{ImageNameR3|}}}
|par_sizeR={{{ImageSizeR3|}}}
|par_altR={{{ImageAltR3|}}}
|par_captionR={{{ImageCaptionR3|}}}
|par_refR={{{ImageFileR3_Ref|}}}
|par_classR={{{ImageClassR3|}}}
|par_captionLR={{{ImageCaptionLR3|}}}
}}
}}
<!-- 
ImageCaptionAll
-->
{{#if:{{{ImageCaptionAll|}}} |{{Chembox image caption all |par_caption={{{ImageCaptionAll}}} }}}}<!--
-->}}<!--
NAMES ----- -->
{{#if:{{{OtherNames|}}}{{{IUPACName|}}}{{{IUPACNames|}}}{{{PIN|}}}{{{SystematicName|}}}|
{{Chembox AllOtherNames
|ref={{{Names_ref|}}}
|pronounce={{{pronounce|}}}
|IUPACName={{{IUPACName|}}} {{{IUPACNames|}}}<!-- plural indicated by editor -->
|PIN={{{PIN|}}}
|SystematicName={{{SystematicName|}}}
|OtherNames={{{OtherNames|}}}
|countIUPACnames={{#if:{{{IUPACNames|}}}|99|{{#ifeq:{{#invoke:String |match |s=_{{{IUPACName|}}} |pattern=%<br%s*%/?%s*%> |nomatch=_NO_BREAK_|plain=false|ignore_errors=false}}|_NO_BREAK_|0|9}}+{{#if:{{{IUPACName|}}}|1|0}} }}<!-- we only need to know: 0-1-many IUPACName/s? -->
}}}}<!--
----- SECTIONS 1-9 ----- -->
{{{Section1|}}}
{{{Section2|}}}
{{{Section3|}}}
{{{Section4|}}}
{{{Section5|}}}
{{{Section6|}}}
{{{Section7|}}}
{{{Section8|}}}
{{{Section9|}}}<!--
----- SUPPLEMENT  (data page) ----- -->
{{Chembox Datapage check
| _targetpage={{#if:{{{data page pagename|}}}|{{{data page pagename|}}}|{{FULLPAGENAME}} (data page)}}
}}<!--
------ FOOTER -----
the visual footer, see also Footer/tracking (below). -->


{{yesno|1={{First nonempty|1={{{show_footer|}}}|2={{yesno|1={{{container_only|no}}}|yes=no|no=yes}}<!-- inversion needed per logic -->}}
<!-- NAMES SECTION -->
|yes={{Chembox Footer
{{#if: {{{OtherNames|}}}{{{IUPACName|}}}{{{PIN|}}}{{{SystematicName|}}} |
 
|-
| Verifiedfields={{{Verifiedfields|}}}
| style="background:#efefef;" | <b>Names</b>
| Watchedfields={{{Watchedfields|}}}
|-
| verifiedrevid={{{verifiedrevid|}}}
| style="padding:5px;" |
| show_ss_note={{{show_ss_note |yes}}}
{{#if: {{{IUPACName|}}} | <b>IUPAC Name:</b> {{{IUPACName}}}<br> }}
| show_infobox_ref={{{show_infobox_ref|yes}}}
{{#if: {{{PIN|}}} | <b>PIN:</b> {{{PIN}}}<br> }}
| general_note={{{general_note|}}}
{{#if: {{{SystematicName|}}} | <b>Systematic Name:</b> {{{SystematicName}}}<br> }}
| width={{{width|22em}}}<!-- infobox width setting, here for feedback only
{{#if: {{{OtherNames|}}} | <b>Other Names:</b> {{{OtherNames}}} }}
end footer -->|no= }}
}}


<!-- SECTIONS -->
{{#if: {{{Section1|}}} |
|-
| style="background:#efefef;" | <b>Section 1</b>
|-
| {{{Section1}}}
}}
{{#if: {{{Section2|}}} |
|-
| style="background:#efefef;" | <b>Section 2</b>
|-
| {{{Section2}}}
}}
{{#if: {{{Section3|}}} |
|-
| style="background:#efefef;" | <b>Section 3</b>
|-
| {{{Section3}}}
}}
{{#if: {{{Section4|}}} |
|-
| style="background:#efefef;" | <b>Section 4</b>
|-
| {{{Section4}}}
}}
{{#if: {{{Section5|}}} |
|-
| style="background:#efefef;" | <b>Section 5</b>
|-
| {{{Section5}}}
}}
{{#if: {{{Section6|}}} |
|-
| style="background:#efefef;" | <b>Section 6</b>
|-
| {{{Section6}}}
}}
{{#if: {{{Section7|}}} |
|-
| style="background:#efefef;" | <b>Section 7</b>
|-
| {{{Section7}}}
}}
{{#if: {{{Section8|}}} |
|-
| style="background:#efefef;" | <b>Section 8</b>
|-
| {{{Section8}}}
}}
{{#if: {{{Section9|}}} |
|-
| style="background:#efefef;" | <b>Section 9</b>
|-
| {{{Section9}}}
}}
}}


|}<!-- END of wikitable (=infobox table)
<!-- FOOTER -->
|-
| style="text-align:center; font-size:90%;" colspan="2" |
{{#if: {{{general_note|}}} | {{{general_note}}}<br> }}
<small>This data is verified and monitored for accuracy.</small>
|}


--><includeonly><!--
<noinclude>
-->{{#if:{{yesno|1={{{container_only|no}}}|yes=yes|no=}}
== Usage ==
|<!-- container_only: -->{{Chembox Footer/tracking_container_only}}
This template is a non-Lua version of `Chembox` for displaying chemical compound information.
|<!-- regular tracking -->{{Chembox Footer/tracking<!-- subtemplate, outside of Footer. See also headerbar (esp in Identifiers).
-->| _hasImage={{{ImageFile|}}}{{{ImageFile1|}}}{{{ImageFile2|}}}{{{ImageFile3|}}}{{{ImageFileL1|}}}{{{ImageFileL2|}}}<!-- the verified images -->{{{ImageFileL3|}}}<!-- R-images not checked here


Images in row 8-9
=== Example ===
-->| _hasImageSizeSet={{{ImageSize|}}}{{{ImageSize1|}}}{{{ImageSize2|}}}{{{ImageSize3|}}}<!--
<syntaxhighlight lang="mediawiki">
-->| _hasImagePairSizeSet={{{ImageSizeL1|}}}{{{ImageSizeL2|}}}{{{ImageSizeL3|}}}{{{ImageSizeR1|}}}{{{ImageSizeR2|}}}{{{ImageSizeR3|}}}<!--
{{Chembox
 
| Name            = Water
-->| _hasLocalImage=<!-- Check if file is local; not above L2, R2
| ImageFile       = Water_Molecule.png
-->{{#switch: en
| ImageSize      = 150px
|{{ParmPart |5 |{{filepath:{{{ImageFile|}}}}}}}
| ImageCaption    = Structure of a water molecule
|{{ParmPart |5 |{{filepath:{{{ImageFile1|}}}}}}}
| IUPACName      = Oxidane
|{{ParmPart |5 |{{filepath:{{{ImageFile2|}}}}}}}
| SystematicName  = Water
|{{ParmPart |5 |{{filepath:{{{ImageFile3|}}}}}}}
| OtherNames      = Dihydrogen monoxide
|{{ParmPart |5 |{{filepath:{{{ImageFileL1|}}}}}}}
| Section1        = <b>Formula:</b> H₂O
|{{ParmPart |5 |{{filepath:{{{ImageFileR1|}}}}}}}
| Section2        = <b>Boiling Point:</b> 100°C
|{{ParmPart |5 |{{filepath:{{{ImageFileL2|}}}}}}}
| general_note    = Common solvent in chemistry
|{{ParmPart |5 |{{filepath:{{{ImageFileR2|}}}}}}}=yes }}<!--
}}
 
</syntaxhighlight>
HAS STYLE SETTINGS
-->| _hasTrackedStyleSettings={{{width|}}}{{{style|}}}{{{show_ss_note|}}}{{{show_infobox_ref|}}}{{{general_note|}}}{{{show_footer|}}}<!--
 
TEMPORAL TRACKING: (optionaly determine and add a sortletter here)
-->|_trackListSortletter = <!-- unused Oct2020
 
end of Chembox tracking subtemplate
-->}}}}</includeonly><!--


-->{{#invoke:TemplatePar
=== Parameters ===
|check
* `Name` - The title or name of the compound.
|template=Template:Chembox
* `ImageFile` - File name for the image.
|all= |opt= Reference= Chembox_ref= IUPACNames= IUPACName= ImageAlt1= ImageAlt2= ImageAlt3= ImageAltL1= ImageAltL2= ImageAltL3= ImageAltR1= ImageAltR2= ImageAltR3= ImageAlt= ImageCaption1= ImageCaption2= ImageCaption3= ImageCaptionL1= ImageNameR1= ImageCaptionL2= ImageCaptionL3= ImageCaptionR1= ImageCaptionR2= ImageCaptionR3= ImageCaptionLR1= ImageCaptionLR2= ImageCaptionLR3= ImageCaption= ImageFile1_Ref= ImageFile1= ImageFile2_Ref= ImageFile2= ImageFile3_Ref= ImageFile3= ImageFileL1_Ref= ImageFileL1= ImageFileL2_Ref= ImageFileL2= ImageFileL3_Ref= ImageFileL3= ImageFileR1_Ref= ImageFileR1= ImageFileR2_Ref= ImageFileR2= ImageFileR3_Ref= ImageFileR3= ImageFile_Ref= ImageFile= ImageName1= ImageName2= ImageName3= ImageNameL1= ImageNameL2= ImageNameL3= ImageNameR2= ImageNameR3= ImageName= ImageSize1= ImageSize2= ImageSize3= ImageSizeL1= ImageSizeL2= ImageSizeL3= ImageSizeR1= ImageSizeR2= ImageSizeR3= ImageSize= ImageClass= ImageClass1= ImageClass2= ImageClass3= ImageClassL1= ImageClassR1= ImageClassL2= ImageClassR2= ImageClassL3= ImageClassR3= Name= OtherNames= pronounce= PIN= Section1= Section2= Section3= Section4= Section5= Section6= Section7= Section8= Section9= SystematicName= Verifiedfields= Watchedfields= verifiedrevid= Verifiedimages= data page pagename= general_note= show_infobox_ref= show_ss_note= show_footer= style= width= container_only=
* `ImageSize` - Size of the image.
* `ImageCaption` - Caption for the image.
* `IUPACName` - IUPAC-approved name.
* `SystematicName` - Systematic chemical name.
* `OtherNames` - Alternative names.
* `Section1`–`Section9` - Custom data sections.
* `general_note` - Footer note for the infobox.


|cat=Pages using Chembox with unknown parameters
== Notes ==
|format=0|preview={{Chembox templatePar/formatPreviewMessage|msg=@@@}}|errNS=0}}<!--
* This template does not use Lua modules.
* Sections 1–9 can be used to add custom content.
* Empty fields will not be displayed.


-->{{short description|Chemical compound|noreplace}}<!--Don't place on top as usual since that requires an extra newline to not break the table which could cause formatting issues.
</noinclude>
--><noinclude>{{documentation}}</noinclude>

Revision as of 17:32, 17 December 2024

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

Chembox - - - - - - - - - - -

This data is verified and monitored for accuracy.


Usage

This template is a non-Lua version of `Chembox` for displaying chemical compound information.

Example

{{Chembox
| Name            = Water
| ImageFile       = Water_Molecule.png
| ImageSize       = 150px
| ImageCaption    = Structure of a water molecule
| IUPACName       = Oxidane
| SystematicName  = Water
| OtherNames      = Dihydrogen monoxide
| Section1        = <b>Formula:</b> H₂O
| Section2        = <b>Boiling Point:</b> 100°C
| general_note    = Common solvent in chemistry
}}

Parameters

  • `Name` - The title or name of the compound.
  • `ImageFile` - File name for the image.
  • `ImageSize` - Size of the image.
  • `ImageCaption` - Caption for the image.
  • `IUPACName` - IUPAC-approved name.
  • `SystematicName` - Systematic chemical name.
  • `OtherNames` - Alternative names.
  • `Section1`–`Section9` - Custom data sections.
  • `general_note` - Footer note for the infobox.

Notes

  • This template does not use Lua modules.
  • Sections 1–9 can be used to add custom content.
  • Empty fields will not be displayed.