Jump to content

Template:Plant Infobox: Difference between revisions

From MTRNord's Wiki
Fix template
Use the wikipedia template instead
Line 1: Line 1:
<templatestyles src="Template:Plant Infobox/styles.css" /><div class="plant-infobox">
{{Infobox
<div class="plant-infobox-title">{{{name|Plant}}}</div>{{#if:{{{common_names|}}}|<div class="plant-infobox-subtitle">{{{common_names}}}</div>}}{{#if:{{{image|}}}|<div class="plant-infobox-image">[[File:{{{image}}}|220px]]{{#if:{{{image_caption|}}}|<br/><small>{{{image_caption}}}</small>}}</div>}}<table>
| bodyclass = plant
{{#if:{{{species|}}}|<tr><td class="plant-label">Scientific Name</td><td>{{{species}}}</td></tr>}}
 
{{#if:{{{location|}}}|<tr><td class="plant-label">Location</td><td>{{{location}}}</td></tr>}}
| aboveclass = plant-name
{{#if:{{{date_planted|}}}|<tr><td class="plant-label">Planted</td><td>{{{date_planted|Unknown}}}</td></tr>}}
| abovestyle = background:palegreen;color:inherit;
{{#if:{{{type|}}}|<tr><td class="plant-label">Type</td><td>{{{type}}}</td></tr>}}
| above = {{{name|<includeonly>{{PAGENAME}}</includeonly>}}}
{{#if:{{{sunlight|}}}|<tr><td class="plant-label">Sunlight</td><td>{{{sunlight}}}</td></tr>}}
 
{{#if:{{{water_needs|}}}|<tr><td class="plant-label">Water Needs</td><td>{{{water_needs}}}</td></tr>}}
| image = {{{image|}}}
{{#if:{{{hardiness_zone|}}}|<tr><td class="plant-label">Hardiness Zone</td><td>{{{hardiness_zone}}}</td></tr>}}
| caption = {{{image_caption|}}}
{{#if:{{{notes|}}}|<tr><td colspan="2" class="plant-section">Care Notes</td></tr><tr><td colspan="2" style="padding:4px 6px;">{{{notes}}}</td></tr>}}
 
</table></div><noinclude>
| labelstyle = padding-top:0.245em;line-height:1.15em;padding-right:0.5em;
| datastyle = min-width:50%;line-height:1.3em;
 
| label1 = Scientific Name
| class1 = species
| data1 = {{{species|}}}
 
| label2 = Common Names
| data2 = {{{common_names|}}}
 
| label3 = Plant Type
| data3 = {{{type|}}}
 
| label4 = Location
| data4 = {{{location|}}}
 
| label5 = Planted
| data5 = {{{date_planted|Unknown}}}
 
| label6 = Sunlight
| data6 = {{{sunlight|}}}
 
| label7 = Water Needs
| data7 = {{{water_needs|}}}
 
| label8 = Hardiness Zone
| data8 = {{{hardiness_zone|}}}
 
| data9 = {{{notes|}}}
 
}}<noinclude>
{{TemplateData
{{TemplateData
|description=Plant information infobox for documenting garden plants
|description=Plant information infobox for documenting garden plants
Line 27: Line 57:
   "image": {
   "image": {
     "label": "Image",
     "label": "Image",
     "description": "Image filename (without File: prefix)",
     "description": "Image filename or full file syntax",
     "type": "wiki-file-name"
     "type": "wiki-file-name"
   },
   },
Line 37: Line 67:
     "label": "Scientific Name",
     "label": "Scientific Name",
     "description": "Botanical/scientific name",
     "description": "Botanical/scientific name",
    "type": "string"
  },
  "type": {
    "label": "Type",
    "description": "perennial, annual, herb, shrub, etc.",
     "type": "string"
     "type": "string"
   },
   },
Line 49: Line 84:
     "type": "date",
     "type": "date",
     "default": "Unknown"
     "default": "Unknown"
  },
  "type": {
    "label": "Type",
    "description": "perennial, annual, herb, shrub, etc.",
    "type": "string"
   },
   },
   "sunlight": {
   "sunlight": {
Line 77: Line 107:
}
}
}}
}}
== Usage ==
<pre>
{{Plant Infobox
| name              = Tomato
| common_names      = Tomato, Tomate
| image            = Tomato_plant.jpg
| image_caption    = Mature plant in July
| species          = Solanum lycopersicum
| location          = Main Bed - South side
| date_planted      = 2025-04-15
| type              = Annual vegetable
| sunlight          = Full sun (6+ hours)
| water_needs      = Regular, 1-2 inches per week
| hardiness_zone    = Annual (all zones)
| notes            = Heritage variety with excellent flavor. Prune suckers for better airflow.
}}
</pre>
All parameters are optional — omit any you don't need and the row won't appear.
</noinclude>
</noinclude>

Revision as of 18:52, 21 April 2026

PlantedUnknown

Template:TemplateData