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:Infobox town: Difference between revisions

Template page
Create Template:Infobox town
 
m Check biome backdrop as .png only, matching Template:Biome -- all biome images were standardised on .png, so the .jpg probe was just a stale redlink source
 
(4 intermediate revisions by the same user not shown)
Line 1: Line 1:
<includeonly><templatestyles src="Template:Infobox town/styles.css" /><div class="loka-town-infobox"><div class="loka-town-name">{{{name|{{PAGENAME}}}}}</div>{{#if:{{{image|}}}|<div class="loka-town-image">[[File:{{{image}}}|280px|frameless|alt={{{name|{{PAGENAME}}}}}]]</div>}}{{#if:{{{mayor|}}}|<div class="loka-town-row"><span class="loka-town-row-key">Mayor</span><span class="loka-town-row-value">{{{mayor|}}}</span></div>}}{{#if:{{{founded|}}}|<div class="loka-town-row"><span class="loka-town-row-key">Founded</span><span class="loka-town-row-value">{{{founded|}}}</span></div>}}{{#if:{{{population|}}}|<div class="loka-town-row"><span class="loka-town-row-key">Population</span><span class="loka-town-row-value">{{{population|}}}</span></div>}}{{#if:{{{biome|}}}|{{#ifexist:File:{{{biome}}}.jpg
<includeonly><templatestyles src="Template:Infobox town/styles.css" />{{Infobox
|<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">[[File:Shield {{lc:{{{continent}}}}}.png|18px|link=]]<span class="loka-town-location-key">Continent</span><span class="loka-town-location-value">{{{continent}}}</span></div><div class="loka-town-location-row">[[File:{{{biome}}} Icon.png|18px|link=]]<span class="loka-town-location-key">Biome</span><span class="loka-town-location-value">{{{biome}}}</span></div><div class="loka-town-location-row loka-town-location-row--noicon"><span class="loka-town-location-key">Tile</span><span class="loka-town-location-value">{{{tile|&mdash;}}}</span></div></div></div>
|name={{{name|{{PAGENAME}}}}}
|{{#ifexist:File:{{{biome}}}.png
|image={{{image|}}}
|<div class="loka-town-location">[[File:{{{biome}}}.png|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">[[File:Shield {{lc:{{{continent}}}}}.png|18px|link=]]<span class="loka-town-location-key">Continent</span><span class="loka-town-location-value">{{{continent}}}</span></div><div class="loka-town-location-row">[[File:{{{biome}}} Icon.png|18px|link=]]<span class="loka-town-location-key">Biome</span><span class="loka-town-location-value">{{{biome}}}</span></div><div class="loka-town-location-row loka-town-location-row--noicon"><span class="loka-town-location-key">Tile</span><span class="loka-town-location-value">{{{tile|&mdash;}}}</span></div></div></div>
|type=
|<div class="loka-town-location loka-town-location--flat"><div class="loka-town-location-heading">Location</div><div class="loka-town-location-row">[[File:Shield {{lc:{{{continent}}}}}.png|18px|link=]]<span class="loka-town-location-key">Continent</span><span class="loka-town-location-value">{{{continent}}}</span></div><div class="loka-town-location-row">[[File:{{{biome}}} Icon.png|18px|link=]]<span class="loka-town-location-key">Biome</span><span class="loka-town-location-value">{{{biome}}}</span></div><div class="loka-town-location-row loka-town-location-row--noicon"><span class="loka-town-location-key">Tile</span><span class="loka-town-location-value">{{{tile|&mdash;}}}</span></div></div>
|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}}}.png
|<div class="loka-town-location">[[File:{{{biome}}}.png|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|&mdash;}}}</span></div></div></div>
|<div class="loka-town-location loka-town-location--flat"><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|&mdash;}}}</span></div></div>
}}
}}
}}
}}
}}</div></includeonly><noinclude>
}}</includeonly><noinclude>
== Usage ==
== Usage ==


Line 13: Line 15:
|name=Example Town
|name=Example Town
|image=Example Town.png
|image=Example Town.png
|mayor=PlayerName
|owner=PlayerName
|founded=March 26, 2026
|founded=March 26, 2026
|population=12
|population=12
Line 22: Line 24:
</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>&lt;biome&gt;.jpg</code>, falling back to <code>.png</code>, then a flat fallback with no photo), the continent row shows that continent's shield, and the biome row shows that biome's icon -- both icons follow the same naming conventions as [[Template:Biome]] and [[Template:Main page/continents]].
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 &mdash; 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>&lt;biome&gt;.png</code>, falling back to a flat panel with no photo if it doesn't exist). The continent shield and biome icon each sit immediately before their own value (the continent/biome name), not the row label.


== Parameters ==
== Parameters ==
Line 36: Line 38:
| Filename of an image uploaded to the wiki (no <code>File:</code> prefix).
| Filename of an image uploaded to the wiki (no <code>File:</code> prefix).
|-
|-
| <code>mayor</code>
| <code>owner</code>
| Current mayor/owner.
| Current town owner.
|-
|-
| <code>founded</code>
| <code>founded</code>
Line 46: Line 48:
|-
|-
| <code>continent</code>
| <code>continent</code>
| Continent the town is on (e.g. <code>Ascalon</code>). Used for the Location section's shield icon; matches the shield filenames used by [[Template:Main page/continents]].
| Continent the town is on (e.g. <code>Ascalon</code>). Used for the Location section's shield icon.
|-
|-
| <code>biome</code>
| <code>biome</code>

Latest revision as of 01:32, 24 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>.png, falling back to a flat panel with no photo if it doesn't exist). 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.
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.