Template:Infobox town: Difference between revisions
Template page
More actions
m Create Template:Infobox town |
m Split remaining inline CSS into /styles.css; delegate shared infobox chrome to Template:Infobox for wiki-wide visual parity |
||
| Line 1: | Line 1: | ||
<includeonly><templatestyles src="Template:Infobox town/styles.css" /> | <includeonly><templatestyles src="Template:Infobox town/styles.css" />{{Infobox | ||
|name={{{name|{{PAGENAME}}}}} | |||
|image={{{image|}}} | |||
|type= | |||
|content={{#if:{{{owner|}}}|<div class="loka-infobox-row"><span class="loka-infobox-row-key">Owner</span><span class="loka-infobox-row-value">{{{owner|}}}</span></div>}}{{#if:{{{founded|}}}|<div class="loka-infobox-row"><span class="loka-infobox-row-key">Founded</span><span class="loka-infobox-row-value">{{{founded|}}}</span></div>}}{{#if:{{{population|}}}|<div class="loka-infobox-row"><span class="loka-infobox-row-key">Population</span><span class="loka-infobox-row-value">{{{population|}}}</span></div>}}{{#if:{{{biome|}}}|{{#ifexist:File:{{{biome}}}.jpg | |||
|<div class="loka-town-location">[[File:{{{biome}}}.jpg|300x140px|link=|alt=]]<div class="loka-town-location-scrim"></div><div class="loka-town-location-content"><div class="loka-town-location-heading">Location</div><div class="loka-town-location-row"><span class="loka-town-location-key">Continent</span><span class="loka-town-location-value">[[File:Shield {{lc:{{{continent}}}}}.png|18px|link=]] {{{continent}}}</span></div><div class="loka-town-location-row"><span class="loka-town-location-key">Biome</span><span class="loka-town-location-value">[[File:{{{biome}}} Icon.png|18px|link=]] {{{biome}}}</span></div><div class="loka-town-location-row"><span class="loka-town-location-key">Tile</span><span class="loka-town-location-value">{{{tile|—}}}</span></div></div></div> | |<div class="loka-town-location">[[File:{{{biome}}}.jpg|300x140px|link=|alt=]]<div class="loka-town-location-scrim"></div><div class="loka-town-location-content"><div class="loka-town-location-heading">Location</div><div class="loka-town-location-row"><span class="loka-town-location-key">Continent</span><span class="loka-town-location-value">[[File:Shield {{lc:{{{continent}}}}}.png|18px|link=]] {{{continent}}}</span></div><div class="loka-town-location-row"><span class="loka-town-location-key">Biome</span><span class="loka-town-location-value">[[File:{{{biome}}} Icon.png|18px|link=]] {{{biome}}}</span></div><div class="loka-town-location-row"><span class="loka-town-location-key">Tile</span><span class="loka-town-location-value">{{{tile|—}}}</span></div></div></div> | ||
|{{#ifexist:File:{{{biome}}}.png | |{{#ifexist:File:{{{biome}}}.png | ||
| Line 6: | Line 10: | ||
}} | }} | ||
}} | }} | ||
}} | }} | ||
}}</includeonly><noinclude> | |||
== Usage == | == Usage == | ||
| Line 22: | Line 27: | ||
</pre> | </pre> | ||
Only <code>name</code> is required (it otherwise defaults to the page name); every other row is hidden when omitted. Supplying <code>biome</code> shows the "Location" section: the panel's backdrop auto-detects the same biome photo [[Template:Biome]] uses (<code><biome>.jpg</code>, falling back to <code>.png</code>, then a flat fallback with no photo). The continent shield and biome icon each sit immediately before their own value (the continent/biome name), not the row label. | Only <code>name</code> is required (it otherwise defaults to the page name); every other row is hidden when omitted. Built on [[Template:Infobox]] for the shared name/image/row chrome -- see there for the wiki's common infobox look. Supplying <code>biome</code> shows the "Location" section: the panel's backdrop auto-detects the same biome photo [[Template:Biome]] uses (<code><biome>.jpg</code>, falling back to <code>.png</code>, then a flat fallback with no photo). The continent shield and biome icon each sit immediately before their own value (the continent/biome name), not the row label. | ||
== Parameters == | == Parameters == | ||
Revision as of 05:41, 18 August 2026
Usage
{{Infobox town
|name=Example Town
|image=Example Town.png
|owner=PlayerName
|founded=March 26, 2026
|population=12
|continent=Ascalon
|biome=Forest
|tile=12,-4
}}
Only name is required (it otherwise defaults to the page name); every other row is hidden when omitted. Built on Template:Infobox for the shared name/image/row chrome -- see there for the wiki's common infobox look. Supplying biome shows the "Location" section: the panel's backdrop auto-detects the same biome photo Template:Biome uses (<biome>.jpg, falling back to .png, then a flat fallback with no photo). The continent shield and biome icon each sit immediately before their own value (the continent/biome name), not the row label.
Parameters
| Parameter | Description |
|---|---|
name
|
Town name. Defaults to the page name. |
image
|
Filename of an image uploaded to the wiki (no File: prefix).
|
owner
|
Current town owner. |
founded
|
Date the town was founded. |
population
|
Current population. |
continent
|
Continent the town is on (e.g. Ascalon). Used for the Location section's shield icon; matches the shield filenames used by Template:Main page/continents.
|
biome
|
Biome the town sits in (e.g. Forest). Drives the whole Location section: enables it, picks its backdrop photo, and picks its icon, both via the same auto-detection Template:Biome uses.
|
tile
|
Tile/coordinate identifier. Shown as-is, no icon. |