Template:Infobox drug: Difference between revisions
Jump to navigation
Jump to search
Danesthesia (talk | contribs) No edit summary Tag: Reverted |
Danesthesia (talk | contribs) No edit summary Tag: Reverted |
||
| Line 1: | Line 1: | ||
To add multiple parameters at once to the Templatedata section of the Infobox drug template, you can use a JSON array to list all the parameters. Here's an example of how you can add multiple parameters at once using a JSON array: | |||
``` | |||
{ | { | ||
"name": "Infobox drug", | "name": "Infobox drug", | ||
| Line 5: | Line 7: | ||
"templateData": { | "templateData": { | ||
"parameters": [ | "parameters": [ | ||
{ | {"name": "drug_name", "description": "The name of the drug.", "type": "string", "required": true}, | ||
{"name": "image", "description": "An image of the drug or its packaging.", "type": "string", "required": false}, | |||
{"name": "width", "description": "The width of the image in pixels.", "type": "number", "required": false}, | |||
{"name": "alt", "description": "Alternative text for the image.", "type": "string", "required": false}, | |||
{"name": "caption", "description": "A brief caption for the image.", "type": "string", "required": false}, | |||
{"name": "pronunciation", "description": "The pronunciation of the drug name.", "type": "string", "required": false}, | |||
{ | {"name": "tradename", "description": "The brand names of the drug.", "type": "string", "required": false}, | ||
{"name": "pregnancy_AU", "description": "The pregnancy category of the drug in Australia.", "type": "string", "required": false}, | |||
{"name": "pregnancy_US", "description": "The pregnancy category of the drug in the United States.", "type": "string", "required": false}, | |||
{"name": "pregnancy_category", "description": "The pregnancy category of the drug.", "type": "string", "required": false}, | |||
{"name": "legal_AU", "description": "The legal status of the drug in Australia.", "type": "string", "required": false}, | |||
{"name": "legal_CA", "description": "The legal status of the drug in Canada.", "type": "string", "required": false}, | |||
{ | {"name": "legal_UK", "description": "The legal status of the drug in the United Kingdom.", "type": "string", "required": false}, | ||
{"name": "legal_US", "description": "The legal status of the drug in the United States.", "type": "string", "required": false}, | |||
{"name": "legal_status", "description": "The legal status of the drug.", "type": "string", "required": false}, | |||
{"name": "routes_of_administration", "description": "The routes of administration for the drug.", "type": "string", "required": false}, | |||
{"name": "bioavailability", "description": "The bioavailability of the drug.", "type": "string", "required": false}, | |||
{"name": "protein_bound", "description": "The protein binding of the drug.", "type": "string", "required": false}, | |||
{ | {"name": "metabolism", "description": "The metabolism of the drug.", "type": "string", "required": false}, | ||
{"name": "elimination_half-life", "description": "The elimination half-life of the drug.", "type": "string", "required": false}, | |||
{"name": "excretion", "description": "The excretion of the drug.", "type": "string", "required": false}, | |||
{"name": "CAS_number", "description": "The CAS registry number for the drug.", "type": "string", "required": false}, | |||
{"name": "ATC_prefix", "description": "The ATC code prefix for the drug.", "type": "string", "required": false}, | |||
{"name": "ATC_suffix", "description": "The ATC code suffix for the drug.", "type": "string", "required": false}, | |||
{ | {"name": "PubChem", "description": "The PubChem Compound ID for the drug.", "type": "string", "required": false}, | ||
{"name": "DrugBank", "description": "The DrugBank ID for the drug.", "type": "string", "required": false}, | |||
{"name": "ChemSpiderID", "description": "The ChemSpider ID for the drug.", "type": "string", "required": false}, | |||
{"name": "UNII", "description": "The Unique Ingredient Identifier for the drug.", "type": "string", "required": false}, | |||
{"name": "KEGG", "description": "The KEGG ID for the drug.", "type": "string", "required": false}, | |||
{"name": "ChEBI", "description": "The ChEBI ID for the drug.", "type": "string", "required": false}, | |||
{ | {"name": "ChEMBL", "description": "The ChEMBL ID for the drug.", "type": "string", "required": false}, | ||
{"name": "chemical_formula", "description": "The chemical formula of the drug.", "type": "string", "required": false}, | |||
{"name": "molecular_weight", "description": "The molecular weight of the drug.", "type": "string", "required": false}, | |||
{"name": "smiles", "description": "The SMILES notation for the drug.", "type": "string", "required": false}, | |||
{"name": "InChI", "description": "The InChI identifier for the drug.", "type": "string", "required": false}, | |||
{"name": "InChIKey", "description": "The InChIKey identifier for the drug.", "type": "string", "required": false} | |||
{ | |||
{ | |||
{ | |||
{ | |||
{ | |||
{ | |||
{ | |||
{ | |||
{ | |||
{ | |||
{ | |||
{ | |||
{ | |||
{ | |||
{ | |||
{ | |||
{ | |||
{ | |||
{ | |||
{ | |||
{ | |||
{ | |||
{ | |||
{ | |||
{ | |||
{ | |||
{ | |||
{ | |||
{ | |||
{ | |||
] | ] | ||
} | } | ||
} | } | ||
``` | |||
In this example, each parameter is listed as a JSON object within the "parameters" array, with the "name", "description", "type", and "required" fields specified for each parameter. | |||
Once you've added this JSON array to the Templatedata section of the Infobox drug template, you can save the changes and preview the template to see how the new parameters are displayed. | |||
Revision as of 04:46, 13 May 2023
To add multiple parameters at once to the Templatedata section of the Infobox drug template, you can use a JSON array to list all the parameters. Here's an example of how you can add multiple parameters at once using a JSON array:
``` {
"name": "Infobox drug",
"description": "A template used to display information about medications.",
"templateData": {
"parameters": [
{"name": "drug_name", "description": "The name of the drug.", "type": "string", "required": true},
{"name": "image", "description": "An image of the drug or its packaging.", "type": "string", "required": false},
{"name": "width", "description": "The width of the image in pixels.", "type": "number", "required": false},
{"name": "alt", "description": "Alternative text for the image.", "type": "string", "required": false},
{"name": "caption", "description": "A brief caption for the image.", "type": "string", "required": false},
{"name": "pronunciation", "description": "The pronunciation of the drug name.", "type": "string", "required": false},
{"name": "tradename", "description": "The brand names of the drug.", "type": "string", "required": false},
{"name": "pregnancy_AU", "description": "The pregnancy category of the drug in Australia.", "type": "string", "required": false},
{"name": "pregnancy_US", "description": "The pregnancy category of the drug in the United States.", "type": "string", "required": false},
{"name": "pregnancy_category", "description": "The pregnancy category of the drug.", "type": "string", "required": false},
{"name": "legal_AU", "description": "The legal status of the drug in Australia.", "type": "string", "required": false},
{"name": "legal_CA", "description": "The legal status of the drug in Canada.", "type": "string", "required": false},
{"name": "legal_UK", "description": "The legal status of the drug in the United Kingdom.", "type": "string", "required": false},
{"name": "legal_US", "description": "The legal status of the drug in the United States.", "type": "string", "required": false},
{"name": "legal_status", "description": "The legal status of the drug.", "type": "string", "required": false},
{"name": "routes_of_administration", "description": "The routes of administration for the drug.", "type": "string", "required": false},
{"name": "bioavailability", "description": "The bioavailability of the drug.", "type": "string", "required": false},
{"name": "protein_bound", "description": "The protein binding of the drug.", "type": "string", "required": false},
{"name": "metabolism", "description": "The metabolism of the drug.", "type": "string", "required": false},
{"name": "elimination_half-life", "description": "The elimination half-life of the drug.", "type": "string", "required": false},
{"name": "excretion", "description": "The excretion of the drug.", "type": "string", "required": false},
{"name": "CAS_number", "description": "The CAS registry number for the drug.", "type": "string", "required": false},
{"name": "ATC_prefix", "description": "The ATC code prefix for the drug.", "type": "string", "required": false},
{"name": "ATC_suffix", "description": "The ATC code suffix for the drug.", "type": "string", "required": false},
{"name": "PubChem", "description": "The PubChem Compound ID for the drug.", "type": "string", "required": false},
{"name": "DrugBank", "description": "The DrugBank ID for the drug.", "type": "string", "required": false},
{"name": "ChemSpiderID", "description": "The ChemSpider ID for the drug.", "type": "string", "required": false},
{"name": "UNII", "description": "The Unique Ingredient Identifier for the drug.", "type": "string", "required": false},
{"name": "KEGG", "description": "The KEGG ID for the drug.", "type": "string", "required": false},
{"name": "ChEBI", "description": "The ChEBI ID for the drug.", "type": "string", "required": false},
{"name": "ChEMBL", "description": "The ChEMBL ID for the drug.", "type": "string", "required": false},
{"name": "chemical_formula", "description": "The chemical formula of the drug.", "type": "string", "required": false},
{"name": "molecular_weight", "description": "The molecular weight of the drug.", "type": "string", "required": false},
{"name": "smiles", "description": "The SMILES notation for the drug.", "type": "string", "required": false},
{"name": "InChI", "description": "The InChI identifier for the drug.", "type": "string", "required": false},
{"name": "InChIKey", "description": "The InChIKey identifier for the drug.", "type": "string", "required": false}
]
}
} ```
In this example, each parameter is listed as a JSON object within the "parameters" array, with the "name", "description", "type", and "required" fields specified for each parameter.
Once you've added this JSON array to the Templatedata section of the Infobox drug template, you can save the changes and preview the template to see how the new parameters are displayed.