Wiki

Template:Infobox room: Difference between revisions

From 2D Tower Wiki
This page was last edited on 7 September 2026, at 06:52.
Create room building infobox template
 
Adapt room infobox to supplied structured template design
Line 2: Line 2:
This template provides a standard infobox for a room building.
This template provides a standard infobox for a room building.


Parameters:
Parameters: <code>Name</code>, <code>Image</code>, <code>Description</code>, <code>Construction cost</code>, <code>Maintenance cost</code>, <code>Workers</code>, <code>Power</code>, <code>Size</code>, and <code>Category</code>.
* <code>Name</code> - room building name.
* <code>Image</code> - optional image filename, such as <code>Hotel.png</code>.
* <code>Description</code> - room building description.
* <code>Construction cost</code> - cost to build the room.
* <code>Maintenance cost</code> - ongoing maintenance cost.
* <code>Workers</code> - workers required.
* <code>Power</code> - power consumption or production.
* <code>Size</code> - footprint or dimensions.
* <code>Category</code> - room building category.


Usage:
<pre>{{Infobox room
<pre>{{Infobox room
|Name=Hotel
|Name=Hotel
Line 26: Line 16:
}}</pre>
}}</pre>
</noinclude>
</noinclude>
<includeonly>
<includeonly><templatestyles src="Template:Infobox room/styles.css" />
<table class="infobox room-infobox" style="float:right; clear:right; width:300px; margin:0 0 1rem 1.5rem; border:1px solid #c8ccd1; border-collapse:collapse; background:#f8f9fa;">
<div class="infobox-wrapper">
<tr><th colspan="2" style="padding:0.75rem; background:#eaecf0; font-size:1.2em;">{{{Name|}}}</th></tr>
<div class="outer-box">
{{#if:{{{Image|}}}|<tr><td colspan="2" style="padding:0.75rem; text-align:center;">[[File:{{{Image}}}|frameless|250px|alt={{{Name|}}}]]</td></tr>}}
<div class="inner-header"><div class="title">{{{Name|Unknown room}}}</div></div>
{{#if:{{{Description|}}}|<tr><td colspan="2" style="padding:0.75rem;">{{{Description}}}</td></tr>}}
{{#if: {{{Image|}}} | <div class="inner-main"><div>[[File:{{{Image}}}{{!}}250x250px{{!}}alt={{{Name|}}}]]</div>{{#if: {{{Description|}}} | <div class="description">{{{Description}}}</div>}}</div> | {{#if: {{{Description|}}} | <div class="inner-main"><div class="description">{{{Description}}}</div></div>}} }}
<tr><th style="padding:0.5rem; text-align:left; border-top:1px solid #c8ccd1;">Construction cost</th><td style="padding:0.5rem; border-top:1px solid #c8ccd1;">{{{Construction cost|—}}}</td></tr>
<div class="inner-table"><table class="table">
<tr><th style="padding:0.5rem; text-align:left;">Maintenance cost</th><td style="padding:0.5rem;">{{{Maintenance cost|—}}}</td></tr>
{{#if:{{{Construction cost|}}}|<tr class="table-tr"><td class="table-td-left">Construction cost</td><td class="table-td-right">{{{Construction cost}}}</td></tr>}}
<tr><th style="padding:0.5rem; text-align:left;">Workers</th><td style="padding:0.5rem;">{{{Workers|—}}}</td></tr>
{{#if:{{{Maintenance cost|}}}|<tr class="table-tr"><td class="table-td-left">Maintenance cost</td><td class="table-td-right">{{{Maintenance cost}}}</td></tr>}}
<tr><th style="padding:0.5rem; text-align:left;">Power</th><td style="padding:0.5rem;">{{{Power|—}}}</td></tr>
{{#if:{{{Workers|}}}|<tr class="table-tr"><td class="table-td-left">Workers</td><td class="table-td-right">{{{Workers}}}</td></tr>}}
<tr><th style="padding:0.5rem; text-align:left;">Size</th><td style="padding:0.5rem;">{{{Size|—}}}</td></tr>
{{#if:{{{Power|}}}|<tr class="table-tr"><td class="table-td-left">Power</td><td class="table-td-right">{{{Power}}}</td></tr>}}
<tr><th style="padding:0.5rem; text-align:left;">Category</th><td style="padding:0.5rem;">{{{Category|—}}}</td></tr>
{{#if:{{{Size|}}}|<tr class="table-tr"><td class="table-td-left">Size</td><td class="table-td-right">{{{Size}}}</td></tr>}}
</table>
{{#if:{{{Category|}}}|<tr class="table-tr"><td class="table-td-left">Category</td><td class="table-td-right">{{{Category}}}</td></tr>}}
</table></div>
</div></div>
</includeonly>
</includeonly>

Revision as of 06:52, 7 September 2026

This template provides a standard infobox for a room building.

Parameters: Name, Image, Description, Construction cost, Maintenance cost, Workers, Power, Size, and Category.

{{Infobox room
|Name=Hotel
|Image=Hotel.png
|Description=Provides accommodation for tenants.
|Construction cost=1000
|Maintenance cost=25
|Workers=2
|Power=10
|Size=4x4
|Category=Residential
}}