Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Template:Substance: Difference between revisions

Template page
No edit summary
Automated sync
 
(5 intermediate revisions by the same user not shown)
Line 1: Line 1:
<noinclude>
<noinclude>
<!-- This file is managed by the altered-wiki-src repository. Do not edit it directly on the wiki — changes will be overwritten on the next deploy. https://github.com/altered-wiki/altered-wiki-src -->
Infobox for substance articles. Automatically annotates the page with Semantic MediaWiki properties.
Infobox for substance articles. Automatically annotates the page with Semantic MediaWiki properties.


Line 53: Line 54:
             "label": "SMILES",
             "label": "SMILES",
             "type": "string"
             "type": "string"
         },
         }
        "legal_de": { "label": "Legal status — Germany", "type": "string" },
        "legal_at": { "label": "Legal status — Austria", "type": "string" },
        "legal_ch": { "label": "Legal status — Switzerland", "type": "string" },
        "legal_us": { "label": "Legal status — United States", "type": "string" },
        "legal_uk": { "label": "Legal status — United Kingdom", "type": "string" },
        "legal_nl": { "label": "Legal status — Netherlands", "type": "string" },
        "legal_ru": { "label": "Legal status — Russia", "type": "string" },
        "legal_by": { "label": "Legal status — Belarus", "type": "string" }
     },
     },
     "format": "block"
     "format": "block"
}
}
</templatedata>
</templatedata>
</noinclude><includeonly>{{#if:{{{class|}}}|{{#set:Substance class={{{class|}}}}}}}{{#if:{{{prodrug_of|}}}|{{#set:Prodrug of={{{prodrug_of|}}}}}}}{{#if:{{{molar_mass|}}}|{{#set:Molar mass={{{molar_mass|}}}}}}}{{#if:{{{smiles|}}}|{{#set:SMILES={{{smiles|}}}}}}}{{#if:{{{iupac|}}}|{{#set:IUPAC name={{{iupac|}}}}}}}{{#if:{{{legal_de|}}}|{{#set:Legal status DE={{{legal_de|}}}}}}}{{#if:{{{legal_at|}}}|{{#set:Legal status AT={{{legal_at|}}}}}}}{{#if:{{{legal_ch|}}}|{{#set:Legal status CH={{{legal_ch|}}}}}}}{{#if:{{{legal_us|}}}|{{#set:Legal status US={{{legal_us|}}}}}}}{{#if:{{{legal_uk|}}}|{{#set:Legal status UK={{{legal_uk|}}}}}}}{{#if:{{{legal_nl|}}}|{{#set:Legal status NL={{{legal_nl|}}}}}}}{{#if:{{{legal_ru|}}}|{{#set:Legal status RU={{{legal_ru|}}}}}}}{{#if:{{{legal_by|}}}|{{#set:Legal status BY={{{legal_by|}}}}}}}
</noinclude><includeonly>{{#if:{{{class|}}}|{{#set:Substance class={{{class|}}}}}}}{{#if:{{{prodrug_of|}}}|{{#set:Prodrug of={{{prodrug_of|}}}}}}}{{#if:{{{molar_mass|}}}|{{#set:Molar mass={{{molar_mass|}}}}}}}{{#if:{{{smiles|}}}|{{#set:SMILES={{{smiles|}}}}}}}{{#if:{{{iupac|}}}|{{#set:IUPAC name={{{iupac|}}}}}}}<table class="infobox-substance" style="float:right; clear:right; margin:0 0 1em 1.5em; width:280px; font-size:0.9em">
{| class="wikitable infobox-substance"
<tr><th colspan="2" class="infobox-substance__title">{{{name|{{PAGENAME}}}}}</th></tr>
! colspan="2" class="infobox-substance__title" | {{{name|{{PAGENAME}}}}}
{{#if:{{{image|}}}|<tr><td colspan="2" class="infobox-substance__image">[[File:{{{image}}}|250px|class=skin-invert-image|{{{image_caption|}}}]]</td></tr>{{#if:{{{image_caption|}}}|<tr><td colspan="2" class="infobox-substance__caption">{{{image_caption}}}</td></tr>}}}}
{{#if:{{{image|}}}|
{{#if:{{{class|}}}|<tr><th>Class</th><td>[[{{{class}}}]]</td></tr>}}
|-
{{#if:{{{prodrug_of|}}}|<tr><th>Prodrug of</th><td>[[Substance:{{{prodrug_of}}}|{{{prodrug_of}}}]]</td></tr>}}
| colspan="2" class="infobox-substance__image" | [[File:{{{image}}}|250px|class=skin-invert-image|{{{image_caption|}}}]]
{{#if:{{{formula|}}}|<tr><th>Formula</th><td>{{{formula}}}</td></tr>}}
{{#if:{{{image_caption|}}}|
{{#if:{{{molar_mass|}}}|<tr><th>Molar mass</th><td>{{{molar_mass}}} g/mol</td></tr>}}
|-
{{#if:{{{cas|}}}|<tr><th>CAS number</th><td>{{{cas}}}</td></tr>}}
| colspan="2" class="infobox-substance__caption" | {{{image_caption|}}}
{{#if:{{{iupac|}}}|<tr><th>IUPAC name</th><td><small>{{{iupac}}}</small></td></tr>}}
}}
{{#if:{{{smiles|}}}|<tr><th>SMILES</th><td><small style="word-break:break-all">{{{smiles}}}</small></td></tr>}}
}}
 
{{#if:{{{class|}}}|
</table></includeonly>
|-
! Class
| [[{{{class}}}]]
}}
{{#if:{{{prodrug_of|}}}|
|-
! Prodrug of
| [[Substance:{{{prodrug_of}}}|{{{prodrug_of}}}]]
}}
{{#if:{{{formula|}}}|
|-
! Formula
| {{{formula}}}
}}
{{#if:{{{molar_mass|}}}|
|-
! Molar mass
| {{{molar_mass}}} g/mol
}}
{{#if:{{{cas|}}}|
|-
! CAS number
| {{{cas}}}
}}
{{#if:{{{iupac|}}}|
|-
! IUPAC name
| <small>{{{iupac}}}</small>
}}
{{#if:{{{smiles|}}}|
|-
! SMILES
| <small style="word-break:break-all">{{{smiles}}}</small>
}}
{{#if:{{{legal_de|}}}{{{legal_at|}}}{{{legal_ch|}}}{{{legal_us|}}}{{{legal_uk|}}}{{{legal_nl|}}}{{{legal_ru|}}}{{{legal_by|}}}|
|-
! colspan="2" class="infobox-substance__section" | Legal status
}}
{{#if:{{{legal_de|}}}|
|-
! Germany
| {{{legal_de}}}
}}
{{#if:{{{legal_at|}}}|
|-
! Austria
| {{{legal_at}}}
}}
{{#if:{{{legal_ch|}}}|
|-
! Switzerland
| {{{legal_ch}}}
}}
{{#if:{{{legal_us|}}}|
|-
! United States
| {{{legal_us}}}
}}
{{#if:{{{legal_uk|}}}|
|-
! United Kingdom
| {{{legal_uk}}}
}}
{{#if:{{{legal_nl|}}}|
|-
! Netherlands
| {{{legal_nl}}}
}}
{{#if:{{{legal_ru|}}}|
|-
! Russia
| {{{legal_ru}}}
}}
{{#if:{{{legal_by|}}}|
|-
! Belarus
| {{{legal_by}}}
}}
|}</includeonly>

Latest revision as of 18:51, 12 May 2026

Infobox for substance articles. Automatically annotates the page with Semantic MediaWiki properties.

Infobox for psychoactive substance articles.

Template parameters[Edit template data]

This template prefers block formatting of parameters.

ParameterDescriptionTypeStatus
Namename

Display name. Defaults to page name.

Stringsuggested
Imageimage

Filename without the File: prefix.

Filesuggested
Image captionimage_caption

no description

Stringoptional
Substance classclass

Pharmacological class, e.g. Benzodiazepine, Opioid, Stimulant.

Stringsuggested
Prodrug ofprodrug_of

Active substance this is a prodrug of (bare name, no namespace).

Stringoptional
Molecular formulaformula

Use <sub> tags for subscripts.

Stringoptional
Molar mass (g/mol)molar_mass

no description

Numberoptional
CAS numbercas

no description

Stringoptional
IUPAC nameiupac

no description

Stringoptional
SMILESsmiles

no description

Stringoptional