Jump to content

Template:Infobox crop: Difference between revisions

From StepHarvest Wiki
Initial StepHarvest theme setup
 
Add description, trellis, special fields
Line 1: Line 1:
<includeonly><templatestyles src="Infobox crop/styles.css" /><div class="sh-infobox">
<includeonly><templatestyles src="Infobox crop/styles.css" /><div class="sh-infobox">
<div class="sh-infobox-title">{{{name|{{PAGENAME}}}}}</div>
<div class="sh-infobox-title">{{{name|{{PAGENAME}}}}}{{#if:{{{special|}}}|&nbsp;★|}}</div>
{{#ifexist:File:{{{image|{{PAGENAME}}}}}.png|<div class="sh-infobox-image">[[File:{{{image|{{PAGENAME}}}}}.png|96px|alt={{{name|{{PAGENAME}}}}}]]</div>|}}<div class="sh-infobox-rows">
{{#ifexist:File:{{{image|{{PAGENAME}}}}}.png|<div class="sh-infobox-image">[[File:{{{image|{{PAGENAME}}}}}.png|96px|alt={{{name|{{PAGENAME}}}}}]]</div>|}}
{{#if:{{{description|}}}|<div class="sh-infobox-desc">{{{description}}}</div>|}}<div class="sh-infobox-rows">
<div class="sh-infobox-section">Growing</div>
<div class="sh-infobox-section">Growing</div>
{{#if:{{{seed|}}}|<div class="sh-infobox-row"><div class="sh-infobox-label">Seed</div><div class="sh-infobox-value">{{{seed}}}</div></div>|}}
{{#if:{{{seed|}}}|<div class="sh-infobox-row"><div class="sh-infobox-label">Seed</div><div class="sh-infobox-value">{{{seed}}}</div></div>|}}
Line 7: Line 8:
{{#if:{{{growth_days|}}}|<div class="sh-infobox-row"><div class="sh-infobox-label">Growth</div><div class="sh-infobox-value">{{{growth_days}}} {{#ifeq:{{{growth_days}}}|1|day|days}}</div></div>|}}
{{#if:{{{growth_days|}}}|<div class="sh-infobox-row"><div class="sh-infobox-label">Growth</div><div class="sh-infobox-value">{{{growth_days}}} {{#ifeq:{{{growth_days}}}|1|day|days}}</div></div>|}}
{{#if:{{{regrowth_days|}}}|<div class="sh-infobox-row"><div class="sh-infobox-label">Regrowth</div><div class="sh-infobox-value">every {{{regrowth_days}}} {{#ifeq:{{{regrowth_days}}}|1|day|days}}</div></div>|}}
{{#if:{{{regrowth_days|}}}|<div class="sh-infobox-row"><div class="sh-infobox-label">Regrowth</div><div class="sh-infobox-value">every {{{regrowth_days}}} {{#ifeq:{{{regrowth_days}}}|1|day|days}}</div></div>|}}
{{#if:{{{trellis|}}}|<div class="sh-infobox-row"><div class="sh-infobox-label">Grows on</div><div class="sh-infobox-value">Trellis</div></div>|}}
{{#if:{{{step_cost_plant|}}}|<div class="sh-infobox-row"><div class="sh-infobox-label">Planting</div><div class="sh-infobox-value">{{Steps|{{{step_cost_plant}}}}}</div></div>|}}
{{#if:{{{step_cost_plant|}}}|<div class="sh-infobox-row"><div class="sh-infobox-label">Planting</div><div class="sh-infobox-value">{{Steps|{{{step_cost_plant}}}}}</div></div>|}}
{{#if:{{{sell_price|}}}{{{sell_price_silver|}}}{{{sell_price_gold|}}}{{{sell_price_pristine|}}}|<div class="sh-infobox-section">Sell prices</div>|}}
{{#if:{{{sell_price|}}}{{{sell_price_silver|}}}{{{sell_price_gold|}}}{{{sell_price_pristine|}}}|<div class="sh-infobox-section">Sell prices</div>|}}
Line 19: Line 21:
|id=String
|id=String
|name=String
|name=String
|seed=String
|seed=Wikitext
|seasons=List (,) of String
|seasons=List (,) of String
|growth_days=Integer
|growth_days=Integer
Line 28: Line 30:
|sell_price_gold=Integer
|sell_price_gold=Integer
|sell_price_pristine=Integer
|sell_price_pristine=Integer
|description=Text
|trellis=Boolean
|special=Boolean
}}
}}
Infobox for crop pages. Parameter names map 1:1 to the game's data fields so a future bulk sync from the game database stays mechanical. All balance numbers belong in these parameters, not in prose, since values are tuned live.
Infobox for crop pages. Parameter names map 1:1 to the game's data fields so a future bulk sync from the game database stays mechanical. All balance numbers belong in these parameters, not in prose, since values are tuned live.
Line 39: Line 44:
|name=Parsnip
|name=Parsnip
|image=Parsnip
|image=Parsnip
|seed=Parsnip Seeds
|seed={{ItemLink|Parsnip Seeds|icon=Parsnip seeds}}
|seasons=spring
|seasons=spring
|growth_days=4
|growth_days=2
|regrowth_days=
|regrowth_days=
|step_cost_plant=80
|step_cost_plant=35
|sell_price=35
|sell_price=55
|sell_price_silver=44
|description=A humble root vegetable. Quick and reliable.
|sell_price_gold=52
|trellis=
|sell_price_pristine=70
|special=
}}
}}
</pre>
</pre>
Line 53: Line 58:
* <code>image</code> defaults to the page name, and the image row only renders when the file exists.
* <code>image</code> defaults to the page name, and the image row only renders when the file exists.
* <code>seasons</code> takes a comma separated list, for example <code>spring, fall</code>.
* <code>seasons</code> takes a comma separated list, for example <code>spring, fall</code>.
* <code>trellis</code> and <code>special</code> are flags: pass <code>yes</code> or leave empty.
* Leave any unknown parameter empty and its row is hidden.
* Leave any unknown parameter empty and its row is hidden.


[[Category:Infobox templates]]
[[Category:Infobox templates]]
</noinclude>
</noinclude>

Revision as of 18:27, 11 June 2026

This template defines the table "crops". View table. Infobox for crop pages. Parameter names map 1:1 to the game's data fields so a future bulk sync from the game database stays mechanical. All balance numbers belong in these parameters, not in prose, since values are tuned live.

Data is also stored in the Cargo table crops, so listing pages ("all spring crops") can be queries instead of hand maintained tables.

Usage

{{Infobox crop
|id=parsnip
|name=Parsnip
|image=Parsnip
|seed={{ItemLink|Parsnip Seeds|icon=Parsnip seeds}}
|seasons=spring
|growth_days=2
|regrowth_days=
|step_cost_plant=35
|sell_price=55
|description=A humble root vegetable. Quick and reliable.
|trellis=
|special=
}}
  • image defaults to the page name, and the image row only renders when the file exists.
  • seasons takes a comma separated list, for example spring, fall.
  • trellis and special are flags: pass yes or leave empty.
  • Leave any unknown parameter empty and its row is hidden.