Template:Plant Infobox: Difference between revisions

Fix template
Fix accidentially used doc page content
 
(2 intermediate revisions by the same user not shown)
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;
{{TemplateData
| datastyle = min-width:50%;line-height:1.3em;
|description=Plant information infobox for documenting garden plants
 
|params=
| 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>
{{Documentation}}
 
<templatedata>
{
{
   "name": {
   "description": "Infobox for plant cultivars and garden documentation",
    "label": "Plant Name",
  "params": {
    "description": "Common name of the plant",
    "name": {
     "type": "string",
      "label": "Plant Name",
     "required": true
      "description": "Common name of the plant",
      "type": "string",
      "required": true
    },
    "image": {
      "label": "Image",
      "description": "Image filename (without File: prefix)",
      "type": "wiki-file-name",
      "suggested": true
    },
    "image_caption": {
      "label": "Image Caption",
      "description": "Caption for the image",
      "type": "string"
    },
    "species": {
      "label": "Scientific Name",
      "description": "Botanical/scientific name",
      "type": "string"
    },
    "common_names": {
      "label": "Common Names",
      "description": "Other common names",
      "type": "string"
    },
    "type": {
      "label": "Plant Type",
      "description": "perennial, annual, herb, shrub, etc.",
      "type": "string"
    },
    "location": {
      "label": "Location",
      "description": "Garden location (e.g. Main Bed - North side)",
      "type": "string"
    },
    "date_planted": {
      "label": "Planted Date",
      "description": "Date planted or 'Unknown'",
      "type": "date"
    },
    "sunlight": {
      "label": "Sunlight",
      "description": "Full sun, partial shade, etc.",
      "type": "string"
    },
     "water_needs": {
      "label": "Water Needs",
      "description": "Regular, drought-tolerant, etc.",
      "type": "string"
    },
     "hardiness_zone": {
      "label": "Hardiness Zone",
      "description": "USDA zone or climate info",
      "type": "string"
    },
    "notes": {
      "label": "Care Notes",
      "description": "Additional care information",
      "type": "string"
    }
   },
   },
   "common_names": {
   "format": "block"
    "label": "Common Names",
    "description": "Other common names",
    "type": "string"
  },
  "image": {
    "label": "Image",
    "description": "Image filename (without File: prefix)",
    "type": "wiki-file-name"
  },
  "image_caption": {
    "label": "Image Caption",
    "type": "string"
  },
  "species": {
    "label": "Scientific Name",
    "description": "Botanical/scientific name",
    "type": "string"
  },
  "location": {
    "label": "Location",
    "description": "Garden location (e.g. Main Bed - North side)",
    "type": "string"
  },
  "date_planted": {
    "label": "Planted Date",
    "description": "Date planted or 'Unknown'",
    "type": "date",
    "default": "Unknown"
  },
  "type": {
    "label": "Type",
    "description": "perennial, annual, herb, shrub, etc.",
    "type": "string"
  },
  "sunlight": {
    "label": "Sunlight",
    "description": "Full sun, partial shade, etc.",
    "type": "string"
  },
  "water_needs": {
    "label": "Water Needs",
    "description": "Regular, drought-tolerant, etc.",
    "type": "string"
  },
  "hardiness_zone": {
    "label": "Hardiness Zone",
    "description": "USDA zone or climate info",
    "type": "string"
  },
  "notes": {
    "label": "Care Notes",
    "description": "Additional care information",
    "type": "string"
  }
}
}
}}
</templatedata>
 
== 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>