Template:Herb: Difference between revisions
Template page
More actions
Aurelianus (talk | contribs) Handle empty Herb preference values cleanly |
Aurelianus (talk | contribs) Add reusable infobox picture field and fallback |
||
| Line 26: | Line 26: | ||
<div class="hw-infobox-title">{{{name|{{PAGENAME}}}}}</div> | <div class="hw-infobox-title">{{{name|{{PAGENAME}}}}}</div> | ||
<div class="hw-infobox-badge">{{{rarity|Unknown}}} specimen</div> | <div class="hw-infobox-badge">{{{rarity|Unknown}}} specimen</div> | ||
<div class="hw-infobox-image" role="group" aria-label="Image for {{{name|{{PAGENAME}}}}}"> | |||
{{#if:{{{image|}}}|[[File:{{{image}}}|frameless|600px|alt={{{name|{{PAGENAME}}}}}]]|<div class="hw-infobox-image-empty">No Picture Uploaded</div>}} | |||
</div> | |||
<div class="hw-infobox-heading">Herb Properties</div> | <div class="hw-infobox-heading">Herb Properties</div> | ||
<div class="hw-infobox-row"><div class="hw-infobox-label">Location</div><div class="hw-infobox-value">[[{{{location|Unknown}}}]]</div></div> | <div class="hw-infobox-row"><div class="hw-infobox-label">Location</div><div class="hw-infobox-value">[[{{{location|Unknown}}}]]</div></div> | ||
| Line 86: | Line 89: | ||
}} | }} | ||
</pre> | </pre> | ||
Set <code>| image = Example.png</code> to display an uploaded file in the infobox. Leave it empty to show “No Picture Uploaded”. | |||
[[Category:Infobox templates]] | [[Category:Infobox templates]] | ||
</noinclude> | </noinclude> | ||
Revision as of 09:29, 29 July 2026
This template defines the table "Herbs". View table. This template stores and displays one centralized herb record.
Usage
{{Herb
| name = Crimson Sun Grass
| key = CrimsonSun
| location = Vast World
| rarity = Common
| preferred crystals = Flame Crystal
| preferred weather = Storm
| preferred time of day = Night
| preferred year = Year 1
| weight = 100
| speed = 1.5
| attack rate = 1
| average size = 0.5
| size range = 0.2
| average price = 15
| degree range = 30
| description = A common herb found in Vast World.
}}
Set | image = Example.png to display an uploaded file in the infobox. Leave it empty to show “No Picture Uploaded”.