Template:Biome: Difference between revisions
Template page
More actions
m Create Template:Biome for reusable biome resource panes |
m Create Template:Biome for reusable biome resource panes |
||
| Line 1: | Line 1: | ||
<includeonly>{{#if:{{{image|}}} | <includeonly><templatestyles src="Template:Biome/styles.css" />{{#if:{{{image|}}} | ||
|<div | |<div class="loka-biome-card loka-biome-card--dark"><div class="loka-biome-backdrop">[[File:{{{image}}}|260px|link=|alt=]]<div class="loka-biome-scrim"></div><div class="loka-biome-title-overlay"><div class="loka-biome-title">{{#ifeq:{{{icon|{{{name}}} Icon.png}}}|none|{{{name}}}|<span class="loka-biome-title-inner">[[File:{{{icon|{{{name}}} Icon.png}}}|20px|link=]]<span>{{{name}}}</span></span>}}</div></div></div><div class="loka-biome-body">{{#if:{{{protected|}}}|<div class="loka-biome-label">Protected Resources</div><div class="loka-biome-row">{{{protected}}}</div>}}{{#if:{{{other|}}}|<div class="loka-biome-label">Other Resources</div><div class="loka-biome-row">{{{other}}}</div>}}</div></div> | ||
|{{#ifexist:File:{{{name}}}.jpg | |{{#ifexist:File:{{{name}}}.jpg | ||
|<div | |<div class="loka-biome-card loka-biome-card--dark"><div class="loka-biome-backdrop">[[File:{{{name}}}.jpg|260px|link=|alt=]]<div class="loka-biome-scrim"></div><div class="loka-biome-title-overlay"><div class="loka-biome-title">{{#ifeq:{{{icon|{{{name}}} Icon.png}}}|none|{{{name}}}|<span class="loka-biome-title-inner">[[File:{{{icon|{{{name}}} Icon.png}}}|20px|link=]]<span>{{{name}}}</span></span>}}</div></div></div><div class="loka-biome-body">{{#if:{{{protected|}}}|<div class="loka-biome-label">Protected Resources</div><div class="loka-biome-row">{{{protected}}}</div>}}{{#if:{{{other|}}}|<div class="loka-biome-label">Other Resources</div><div class="loka-biome-row">{{{other}}}</div>}}</div></div> | ||
|{{#ifexist:File:{{{name}}}.png | |{{#ifexist:File:{{{name}}}.png | ||
|<div | |<div class="loka-biome-card loka-biome-card--dark"><div class="loka-biome-backdrop">[[File:{{{name}}}.png|260px|link=|alt=]]<div class="loka-biome-scrim"></div><div class="loka-biome-title-overlay"><div class="loka-biome-title">{{#ifeq:{{{icon|{{{name}}} Icon.png}}}|none|{{{name}}}|<span class="loka-biome-title-inner">[[File:{{{icon|{{{name}}} Icon.png}}}|20px|link=]]<span>{{{name}}}</span></span>}}</div></div></div><div class="loka-biome-body">{{#if:{{{protected|}}}|<div class="loka-biome-label">Protected Resources</div><div class="loka-biome-row">{{{protected}}}</div>}}{{#if:{{{other|}}}|<div class="loka-biome-label">Other Resources</div><div class="loka-biome-row">{{{other}}}</div>}}</div></div> | ||
|<div | |<div class="loka-biome-card loka-biome-card--light"><div class="loka-biome-title loka-biome-title--light">{{#ifeq:{{{icon|{{{name}}} Icon.png}}}|none|{{{name}}}|<span class="loka-biome-title-inner">[[File:{{{icon|{{{name}}} Icon.png}}}|20px|link=]]<span>{{{name}}}</span></span>}}</div>{{#if:{{{protected|}}}|<div class="loka-biome-label loka-biome-label--light">Protected Resources</div><div class="loka-biome-row">{{{protected}}}</div>}}{{#if:{{{other|}}}|<div class="loka-biome-label loka-biome-label--light">Other Resources</div><div class="loka-biome-row">{{{other}}}</div>}}</div> | ||
}} | }} | ||
}} | }} | ||
| Line 19: | Line 19: | ||
</pre> | </pre> | ||
Renders a single biome pane for use on "Biomes and Resources"-style pages, or on any article (e.g. a continent article) that needs to show a biome's protected and other resources. | Renders a single biome pane for use on "Biomes and Resources"-style pages, or on any article (e.g. a continent article) that needs to show a biome's protected and other resources. Styling lives in [[Template:Biome/styles.css]]. | ||
Only <code>name</code> is required. Both the icon (<code><name> Icon.png</code>) and the backdrop image (<code><name>.jpg</code>, falling back to <code><name>.png</code>) are auto-detected from the biome name via file-existence checks, so a normal call only needs <code>name</code>, <code>protected</code> and <code>other</code>. If neither backdrop file exists, the pane renders as a flat light card instead. | Only <code>name</code> is required. Both the icon (<code><name> Icon.png</code>) and the backdrop image (<code><name>.jpg</code>, falling back to <code><name>.png</code>) are auto-detected from the biome name via file-existence checks, so a normal call only needs <code>name</code>, <code>protected</code> and <code>other</code>. If neither backdrop file exists, the pane renders as a flat light card instead. | ||
Revision as of 19:07, 17 August 2026
Usage
{{Biome
|name=Birch Forest
|protected={{ResourceList|1=Birch Wood|1icon1=Birch Log.png}}
|other={{ResourceList|1=Dandelion|1icon1=Dandelion.png}}
}}
Renders a single biome pane for use on "Biomes and Resources"-style pages, or on any article (e.g. a continent article) that needs to show a biome's protected and other resources. Styling lives in Template:Biome/styles.css.
Only name is required. Both the icon (<name> Icon.png) and the backdrop image (<name>.jpg, falling back to <name>.png) are auto-detected from the biome name via file-existence checks, so a normal call only needs name, protected and other. If neither backdrop file exists, the pane renders as a flat light card instead.
Parameters
| Parameter | Description |
|---|---|
name
|
Biome display name. Also used to auto-detect the icon and backdrop filenames. |
icon
|
Overrides the auto-detected icon filename (no File: prefix). Set to none to suppress the icon entirely (e.g. for a non-biome-specific entry with no matching icon file).
|
image
|
Overrides the auto-detected backdrop filename directly (no File: prefix), for the rare case it doesn't follow the <name>.jpg/<name>.png convention.
|
protected
|
Wikitext for the "Protected Resources" chips — normally a Template:ResourceList call. |
other
|
Wikitext for the "Other Resources" chips, same format as protected.
|