Jump to content

Template:Plant Infobox: Difference between revisions

From MTRNord's Wiki
Initial Template
 
Fix template
Line 1: Line 1:
<includeonly>{{#if:{{{name|}}}|[[Category:Garden Plants]]}}</includeonly><noinclude>
<templatestyles src="Template:Plant Infobox/styles.css" /><div class="plant-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>
{{#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>}}
{{#if:{{{date_planted|}}}|<tr><td class="plant-label">Planted</td><td>{{{date_planted|Unknown}}}</td></tr>}}
{{#if:{{{type|}}}|<tr><td class="plant-label">Type</td><td>{{{type}}}</td></tr>}}
{{#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>}}
{{#if:{{{hardiness_zone|}}}|<tr><td class="plant-label">Hardiness Zone</td><td>{{{hardiness_zone}}}</td></tr>}}
{{#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>
{{TemplateData
{{TemplateData
|description=Plant information infobox with metadata for visual editor
|description=Plant information infobox for documenting garden plants
|params=
|params=
{
{
Line 9: Line 19:
     "type": "string",
     "type": "string",
     "required": true
     "required": true
  },
  "common_names": {
    "label": "Common Names",
    "description": "Other common names",
    "type": "string"
   },
   },
   "image": {
   "image": {
     "label": "Image",
     "label": "Image",
     "description": "Plant photo - use [[File:name.jpg|250px]]",
     "description": "Image filename (without File: prefix)",
     "type": "wiki-file-name"
     "type": "wiki-file-name"
  },
  "image_caption": {
    "label": "Image Caption",
    "type": "string"
   },
   },
   "species": {
   "species": {
     "label": "Scientific Name",
     "label": "Scientific Name",
     "description": "Scientific/botanical name (e.g. Solanum lycopersicum)",
     "description": "Botanical/scientific name",
    "type": "string"
  },
  "common_names": {
    "label": "Common Names",
    "description": "Other common names for the plant",
     "type": "string"
     "type": "string"
   },
   },
   "location": {
   "location": {
     "label": "Location",
     "label": "Location",
     "description": "Where in the garden (e.g. Main Bed - North side)",
     "description": "Garden location (e.g. Main Bed - North side)",
     "type": "string"
     "type": "string"
   },
   },
Line 37: Line 51:
   },
   },
   "type": {
   "type": {
     "label": "Plant Type",
     "label": "Type",
     "description": "perennial, annual, herb, shrub, etc.",
     "description": "perennial, annual, herb, shrub, etc.",
     "type": "string"
     "type": "string"
   },
   },
   "sunlight": {
   "sunlight": {
     "label": "Sunlight Requirements",
     "label": "Sunlight",
     "description": "Full sun, partial shade, etc.",
     "description": "Full sun, partial shade, etc.",
     "type": "string"
     "type": "string"
Line 57: Line 71:
   },
   },
   "notes": {
   "notes": {
     "label": "Notes",
     "label": "Care Notes",
     "description": "Additional notes about the plant",
     "description": "Additional care information",
     "type": "string"
     "type": "string"
   }
   }
}
}
}}
}}
This template creates a plant information infobox with visual editor support.
 
Usage: {{Plant Infobox|name=|species=|location=|date_planted=|...}}
== Usage ==
</noinclude>{| class="infobox plant-infobox"
<pre>
|-
{{Plant Infobox
! colspan="2" class="plant-infobox-header" | <big>{{{name|Plant Name}}}</big>
| name              = Tomato
|-
| common_names      = Tomato, Tomate
| style="text-align:center" colspan="2" | {{{image|[[File:Example.jpg|250px]]}}}
| image             = Tomato_plant.jpg
|-
| image_caption    = Mature plant in July
| '''Scientific Name:''' || {{{species|-}}}
| species           = Solanum lycopersicum
|-
| location         = Main Bed - South side
| '''Common Names:''' || {{{common_names|-}}}
| date_planted      = 2025-04-15
|-
| type             = Annual vegetable
| '''Location:''' || {{{location|-}}}
| sunlight          = Full sun (6+ hours)
|-
| water_needs      = Regular, 1-2 inches per week
| '''Planted:''' || {{{date_planted|Unknown}}}
| hardiness_zone    = Annual (all zones)
|-
| notes            = Heritage variety with excellent flavor. Prune suckers for better airflow.
| '''Type:''' || {{{type|}}}<br/>''(perennial, annual, herb, etc.)''
}}
|-
</pre>
| '''Sunlight:''' || {{{sunlight|-}}}
 
|-
All parameters are optional — omit any you don't need and the row won't appear.
| '''Water Needs:''' || {{{water_needs|-}}}
 
|-
</noinclude>
| '''Zone/Climate:''' || {{{hardiness_zone|-}}}
|-
| '''Notes:''' || {{{notes|-}}}
|}

Revision as of 17:52, 21 April 2026

Page Template:Plant Infobox/styles.css has no content.

Plant





Template:TemplateData

Usage

{{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.
}}

All parameters are optional — omit any you don't need and the row won't appear.