Jump to content
Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Template:Biome: Difference between revisions

Template page
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>{{#if:{{#if:{{{ext|}}}|1|{{{image|}}}}}
|<div style="border-radius:8px;overflow:hidden;border:1px solid #4a4030;background:#1c1712;box-shadow:0 1px 3px rgba(0,0,0,.2);">
|<div style="border-radius:8px;overflow:hidden;border:1px solid #4a4030;background:#1c1712;box-shadow:0 1px 3px rgba(0,0,0,.2);">
<div style="position:relative;line-height:0;height:108px;overflow:hidden;">[[File:{{{image}}}|260px|link=|alt=]]<div style="position:absolute;inset:0;background:rgba(8,6,3,.58);"></div><div style="position:absolute;left:0;right:0;bottom:0;padding:.4em .6em .35em;"><div style="font-weight:700;font-size:1em;color:#ffffff;text-shadow:0 1px 4px rgba(0,0,0,.9);line-height:1.3;">{{#if:{{{icon|}}}|<span style="display:inline-flex;align-items:center;gap:.35em;">[[File:{{{icon}}}|20px|link=]]<span>{{{name}}}</span></span>|{{{name}}}}}</div></div></div>
<div style="position:relative;line-height:0;height:108px;overflow:hidden;">[[File:{{#if:{{{ext|}}}|{{{name}}}.{{{ext}}}|{{{image|}}}}}|260px|link=|alt=]]<div style="position:absolute;inset:0;background:rgba(8,6,3,.58);"></div><div style="position:absolute;left:0;right:0;bottom:0;padding:.4em .6em .35em;"><div style="font-weight:700;font-size:1em;color:#ffffff;text-shadow:0 1px 4px rgba(0,0,0,.9);line-height:1.3;">{{#ifeq:{{{icon|{{{name}}} Icon.png}}}|none|{{{name}}}|<span style="display:inline-flex;align-items:center;gap:.35em;">[[File:{{{icon|{{{name}}} Icon.png}}}|20px|link=]]<span>{{{name}}}</span></span>}}</div></div></div>
<div style="background:#1c1712;padding:.55em .7em .65em;">{{#if:{{{protected|}}}|<div style="font-size:.7em;font-weight:700;color:#f0cf8e;text-transform:uppercase;letter-spacing:.04em;margin:.45em 0 .25em;">Protected Resources</div><div style="display:flex;flex-wrap:wrap;gap:.3em;">{{{protected}}}</div>}}{{#if:{{{other|}}}|<div style="font-size:.7em;font-weight:700;color:#f0cf8e;text-transform:uppercase;letter-spacing:.04em;margin:.45em 0 .25em;">Other Resources</div><div style="display:flex;flex-wrap:wrap;gap:.3em;">{{{other}}}</div>}}</div></div>
<div style="background:#1c1712;padding:.55em .7em .65em;">{{#if:{{{protected|}}}|<div style="font-size:.7em;font-weight:700;color:#f0cf8e;text-transform:uppercase;letter-spacing:.04em;margin:.45em 0 .25em;">Protected Resources</div><div style="display:flex;flex-wrap:wrap;gap:.3em;">{{{protected}}}</div>}}{{#if:{{{other|}}}|<div style="font-size:.7em;font-weight:700;color:#f0cf8e;text-transform:uppercase;letter-spacing:.04em;margin:.45em 0 .25em;">Other Resources</div><div style="display:flex;flex-wrap:wrap;gap:.3em;">{{{other}}}</div>}}</div></div>
|<div style="background:#faf7f0;border:1px solid #d8cfb8;border-radius:8px;padding:.6em .7em;box-shadow:0 1px 3px rgba(0,0,0,.1);"><div style="font-weight:700;font-size:1em;color:#1f1c16;border-bottom:1px solid #e5ddc8;padding-bottom:.3em;margin-bottom:.2em;">{{#if:{{{icon|}}}|<span style="display:inline-flex;align-items:center;gap:.35em;">[[File:{{{icon}}}|20px|link=]]<span>{{{name}}}</span></span>|{{{name}}}}}</div>{{#if:{{{protected|}}}|<div style="font-size:.7em;font-weight:700;color:#9c6b2e;text-transform:uppercase;letter-spacing:.04em;margin:.45em 0 .25em;">Protected Resources</div><div style="display:flex;flex-wrap:wrap;gap:.3em;">{{{protected}}}</div>}}{{#if:{{{other|}}}|<div style="font-size:.7em;font-weight:700;color:#9c6b2e;text-transform:uppercase;letter-spacing:.04em;margin:.45em 0 .25em;">Other Resources</div><div style="display:flex;flex-wrap:wrap;gap:.3em;">{{{other}}}</div>}}</div>
|<div style="background:#faf7f0;border:1px solid #d8cfb8;border-radius:8px;padding:.6em .7em;box-shadow:0 1px 3px rgba(0,0,0,.1);"><div style="font-weight:700;font-size:1em;color:#1f1c16;border-bottom:1px solid #e5ddc8;padding-bottom:.3em;margin-bottom:.2em;">{{#ifeq:{{{icon|{{{name}}} Icon.png}}}|none|{{{name}}}|<span style="display:inline-flex;align-items:center;gap:.35em;">[[File:{{{icon|{{{name}}} Icon.png}}}|20px|link=]]<span>{{{name}}}</span></span>}}</div>{{#if:{{{protected|}}}|<div style="font-size:.7em;font-weight:700;color:#9c6b2e;text-transform:uppercase;letter-spacing:.04em;margin:.45em 0 .25em;">Protected Resources</div><div style="display:flex;flex-wrap:wrap;gap:.3em;">{{{protected}}}</div>}}{{#if:{{{other|}}}|<div style="font-size:.7em;font-weight:700;color:#9c6b2e;text-transform:uppercase;letter-spacing:.04em;margin:.45em 0 .25em;">Other Resources</div><div style="display:flex;flex-wrap:wrap;gap:.3em;">{{{other}}}</div>}}</div>
}}</includeonly><noinclude>
}}</includeonly><noinclude>
== Usage ==
== Usage ==
Line 9: Line 9:
<pre>
<pre>
{{Biome
{{Biome
|name=Forest
|name=Birch Forest
|icon=Forest Icon.png
|ext=png
|image=Forest.jpg
|protected={{ResourceList|1=Birch Wood|1icon1=Birch Log.png}}
|protected=[[File:Bee.png|16px|link=]]Bees
|other={{ResourceList|1=Dandelion|1icon1=Dandelion.png}}
|other=[[File:Dandelion.png|16px|link=]]Dandelions
}}
}}
</pre>
</pre>
Line 19: Line 18:
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.


Only <code>name</code> is required. Omitting <code>image</code> renders a flat light card instead of a photo backdrop; omitting <code>icon</code>, <code>protected</code>, or <code>other</code> simply hides that part.
Only <code>name</code> is required. The icon defaults to <code>&lt;name&gt; Icon.png</code> automatically, so most calls only need <code>name</code>, <code>ext</code>, <code>protected</code> and <code>other</code>. Omitting <code>ext</code> renders a flat light card with no photo backdrop.


== Parameters ==
== Parameters ==
Line 28: Line 27:
|-
|-
| <code>name</code>
| <code>name</code>
| Biome display name.
| Biome display name. Also used to build the default icon and backdrop filenames.
|-
| <code>ext</code>
| File extension of the backdrop screenshot (<code>jpg</code> or <code>png</code>), e.g. <code>ext=jpg</code> uses <code>File:{{{name}}}.jpg</code>. Omit if this biome has no backdrop.
|-
|-
| <code>icon</code>
| <code>icon</code>
| Filename of a small (20px) icon shown to the left of the name. Do not include the <code>File:</code> prefix.
| Overrides the default icon filename (no <code>File:</code> prefix). Set to <code>none</code> to suppress the icon entirely (e.g. for a non-biome-specific entry with no matching icon file).
|-
|-
| <code>image</code>
| <code>image</code>
| Filename of a backdrop screenshot. Do not include the <code>File:</code> prefix. Cropped to a fixed height, top-anchored.
| Overrides the backdrop filename directly (no <code>File:</code> prefix), for the rare case it doesn't follow the <code>&lt;name&gt;.&lt;ext&gt;</code> convention. Ignored if <code>ext</code> is set.
|-
|-
| <code>protected</code>
| <code>protected</code>
| Pre-formatted wikitext/HTML for the "Protected Resources" chips (e.g. a run of <code>[[File:Icon.png|16px|link=]]Term</code> chips).
| Wikitext for the "Protected Resources" chips &mdash; normally a [[Template:ResourceList]] call.
|-
|-
| <code>other</code>
| <code>other</code>
| Pre-formatted wikitext/HTML for the "Other Resources" chips, same format as <code>protected</code>.
| Wikitext for the "Other Resources" chips, same format as <code>protected</code>.
|}
|}


[[Category:Templates]]
[[Category:Templates]]
</noinclude>
</noinclude>

Revision as of 18:08, 17 August 2026

Usage

{{Biome
|name=Birch Forest
|ext=png
|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.

Only name is required. The icon defaults to <name> Icon.png automatically, so most calls only need name, ext, protected and other. Omitting ext renders a flat light card with no photo backdrop.

Parameters

Parameter Description
name Biome display name. Also used to build the default icon and backdrop filenames.
ext File extension of the backdrop screenshot (jpg or png), e.g. ext=jpg uses File:{{{name}}}.jpg. Omit if this biome has no backdrop.
icon Overrides the default 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 backdrop filename directly (no File: prefix), for the rare case it doesn't follow the <name>.<ext> convention. Ignored if ext is set.
protected Wikitext for the "Protected Resources" chips — normally a Template:ResourceList call.
other Wikitext for the "Other Resources" chips, same format as protected.