Template:SubstanceSidebar: Difference between revisions

From Avi's Drug Diary
Created page with "<noinclude> {{#cargo_declare: _table=Substances |Title=String |Type=String |Category=String |ChemicalName=String |Aliases=List (;) of String |ROAs=List (;) of String |DrugClasses=List (;) of String }} </noinclude><includeonly> {{#cargo_store: _table=Substances |Title={{{title|}}} |Type={{{type|}}} |Category={{{category|}}} |ChemicalName={{{chemical_name|}}} |Aliases={{{aliases|}}} |ROAs={{{roas|}}} |DrugClasses={{{drug_classes|}}} }} <div style="float:right; width:34..."
 
Compact template; no leading <p>; dosage nests without nested float
 
Line 1: Line 1:
<noinclude>
<noinclude>
{{#cargo_declare:
{{#cargo_declare:
_table=Substances
_table=Substances
Line 11: Line 10:
|DrugClasses=List (;) of String
|DrugClasses=List (;) of String
}}
}}
 
</noinclude><includeonly>{{#cargo_store:
</noinclude><includeonly>
 
{{#cargo_store:
_table=Substances
_table=Substances
|Title={{{title|}}}
|Title={{{title|}}}
Line 23: Line 19:
|ROAs={{{roas|}}}
|ROAs={{{roas|}}}
|DrugClasses={{{drug_classes|}}}
|DrugClasses={{{drug_classes|}}}
}}
}}<div class="substance-sidebar" style="float:right;width:340px;margin:0 0 1em 1.25em;clear:right">
 
<table class="wikitable" style="width:100%;margin:0">
<div style="float:right; width:340px; margin-left:20px; margin-bottom:20px;">
<tr><th colspan="2">{{{title|Untitled}}}</th></tr>
 
{{#if:{{{type|}}}|<tr><th>Type</th><td>{{{type}}}</td></tr>}}
<table class="wikitable" style="width:100%;">
{{#if:{{{category|}}}|<tr><th>Category</th><td>{{{category}}}</td></tr>}}
<tr>
{{#if:{{{chemical_name|}}}|<tr><th>Chemical Name</th><td>{{{chemical_name}}}</td></tr>}}
<th colspan="2">{{{title|Untitled}}}</th>
{{#if:{{{aliases|}}}|<tr><th>Aliases</th><td>{{#replace:{{{aliases}}}|;|,&#32;}}</td></tr>}}
</tr>
{{#if:{{{roas|}}}|<tr><th>ROA(s)</th><td>{{#replace:{{{roas}}}|;|,&#32;}}</td></tr>}}
 
{{#if:{{{drug_classes|}}}|<tr><th>Drug Class(es)</th><td>{{#replace:{{{drug_classes}}}|;|,&#32;}}</td></tr>}}
{{#if:{{{type|}}}|
<tr>
<th>Type</th>
<td>{{{type}}}</td>
</tr>
}}
 
{{#if:{{{category|}}}|
<tr>
<th>Category</th>
<td>{{{category}}}</td>
</tr>
}}
 
{{#if:{{{chemical_name|}}}|
<tr>
<th>Chemical Name</th>
<td>{{{chemical_name}}}</td>
</tr>
}}
 
{{#if:{{{aliases|}}}|
<tr>
<th>Aliases</th>
<td>{{{aliases}}}</td>
</tr>
}}
 
{{#if:{{{roas|}}}|
<tr>
<th>ROA(s)</th>
<td>{{{roas}}}</td>
</tr>
}}
 
{{#if:{{{drug_classes|}}}|
<tr>
<th>Drug Class(es)</th>
<td>{{{drug_classes}}}</td>
</tr>
}}
 
</table>
</table>
 
{{#if:{{{dosage|}}}|<div class="report-dosage" style="margin-top:0.5em">{{{dosage}}}</div>}}
<div class="report-dosage">
</div></includeonly>
{{{dosage|}}}
</div>
 
</div>
 
</includeonly>

Latest revision as of 17:44, 9 August 2026

This template defines the table "Substances". View table.