Template:Resource: Difference between revisions
Template page
More actions
Create Template:Resource for reusable resource chips |
m Create Template:Resource for reusable resource chips |
||
| (2 intermediate revisions by the same user not shown) | |||
| Line 1: | Line 1: | ||
<includeonly>{{#ifeq:{{{theme|dark}}}|light | <includeonly><templatestyles src="Template:Resource/styles.css" />{{#ifeq:{{{theme|dark}}}|light | ||
|<span | |<span class="loka-resource-chip loka-resource-chip--light"><span class="loka-resource-icons">{{#if:{{{icon1|}}}|[[File:{{{icon1}}}|16x16px|link=]]}}{{#if:{{{icon2|}}}|[[File:{{{icon2}}}|16x16px|link=]]}}{{#if:{{{icon3|}}}|[[File:{{{icon3}}}|16x16px|link=]]}}</span><span class="loka-resource-text">{{{term}}}</span></span> | ||
|<span | |<span class="loka-resource-chip loka-resource-chip--dark"><span class="loka-resource-icons">{{#if:{{{icon1|}}}|[[File:{{{icon1}}}|16x16px|link=]]}}{{#if:{{{icon2|}}}|[[File:{{{icon2}}}|16x16px|link=]]}}{{#if:{{{icon3|}}}|[[File:{{{icon3}}}|16x16px|link=]]}}</span><span class="loka-resource-text">{{{term}}}</span></span> | ||
}}</includeonly><noinclude> | }}</includeonly><noinclude> | ||
== Usage == | == Usage == | ||
| Line 7: | Line 7: | ||
<pre> | <pre> | ||
{{Resource | {{Resource | ||
|term= | |term=Apple | ||
|icon1=Apple.png | |icon1=Apple.png | ||
|theme=dark | |theme=dark | ||
| Line 13: | Line 13: | ||
</pre> | </pre> | ||
Renders a single pill-shaped resource chip, for use inside [[Template:Biome]]'s <code>protected</code>/<code>other</code> parameters (or anywhere else a small icon-tagged resource label is useful). | Renders a single pill-shaped resource chip, for use inside [[Template:Biome]]'s <code>protected</code>/<code>other</code> parameters (or anywhere else a small icon-tagged resource label is useful). Styling lives in [[Template:Resource/styles.css]]. | ||
Only <code>term</code> is required. Up to three icons can be shown (some resources cover multiple items, e.g. "Mushroom | Only <code>term</code> is required. Up to three icons can be shown (some resources cover multiple items, e.g. "Mushroom Block (Red/Brown/Stem)"). <code>theme</code> selects the pill's colour scheme to match its surroundings. | ||
== Parameters == | == Parameters == | ||
| Line 27: | Line 27: | ||
|- | |- | ||
| <code>icon1</code> / <code>icon2</code> / <code>icon3</code> | | <code>icon1</code> / <code>icon2</code> / <code>icon3</code> | ||
| Filenames (no <code>File:</code> prefix) of up to three | | Filenames (no <code>File:</code> prefix) of up to three icons shown before the text, capped to a 16x16 box. | ||
|- | |- | ||
| <code>theme</code> | | <code>theme</code> | ||
Latest revision as of 19:07, 17 August 2026
Usage
{{Resource
|term=Apple
|icon1=Apple.png
|theme=dark
}}
Renders a single pill-shaped resource chip, for use inside Template:Biome's protected/other parameters (or anywhere else a small icon-tagged resource label is useful). Styling lives in Template:Resource/styles.css.
Only term is required. Up to three icons can be shown (some resources cover multiple items, e.g. "Mushroom Block (Red/Brown/Stem)"). theme selects the pill's colour scheme to match its surroundings.
Parameters
| Parameter | Description |
|---|---|
term
|
The resource's display text. |
icon1 / icon2 / icon3
|
Filenames (no File: prefix) of up to three icons shown before the text, capped to a 16x16 box.
|
theme
|
dark (default) for use on a dark/photo-backdrop panel, or light for a flat light card.
|