Template:Building/doc

Revision as of 20:38, 10 May 2025 by Mango Stellaris (talk | contribs) (1 revision imported)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
This is the documentation page for Template:Building.
When it is viewed directly, links using variables may appear broken; do not replace these with hardcoded page names or URLs.

This template removes 20px, scaled by defined size, from the left and bottom of building image files and makes the image link to an anchor within Buildings

Parameters edit

Parameter Description Required Default
1 Building image file name, not including "Building_" or ".png"
Changes dashes - to underscores _
  • This parameter can be omitted if using icon and either 3 or link
optional
2 Building name, shown in hover text.
Sets image size instead if w is not used. Do not use unless used alongside the w parameter.
optional [1]
3 Building name, shown in hover text. Overrides parameter 2. optional [1]
w Image size, with or without px optional 78px
icon Alternate image file, not including ".png" optional [1]
icon type Replaces "Building" at the start of the file name. Most useful for holdings. optional Building
link Sets custom link optional [type]#[3] else [type]#[1]
type Sets link page; one of:
Ignored if link is used
optional Buildings
margin Additional margin-left applied after initial icon formatting
  • Set only as a number, without "px"
  • Can be a negative value
optional

Examples edit

Basic format: {{building|image name|size|hover text}}

Note that the template automatically capitalizes the first letter for default link, but it may be necessary to manually capitalize other parts in order to properly link to a section or anchor. Check also that the link points to an actual building anchor, especially when the icon name does not match the in-game name.

Wikitext Produces
[[File:Building research lab 1.png]] File:Building research lab 1.png
{{building|research lab 1}} <span style="display:block;

margin-left: Expression error: Unrecognized punctuation character "{".px; margin-bottom: Expression error: Unrecognized punctuation character "{".px; ">[[File:Building_{{#replace:research lab 1|-|_}}.png|Expression error: Unrecognized punctuation character "{".px|link=Buildings#research lab 1|research lab 1]]

{{building|research lab 1|Research Labs|w=60px}} <span style="display:block;

margin-left: Expression error: Unrecognized punctuation character "{".px; margin-bottom: Expression error: Unrecognized punctuation character "{".px; ">[[File:Building_{{#replace:research lab 1|-|_}}.png|Expression error: Unrecognized punctuation character "{".px|link=Buildings#Research Labs|Research Labs]]

When linking to buildings that are not on the page Buildings, use the type or link parameters to set the correct page link.

Wikitext Produces
{{building|embassy|Embassy Complex|w=60px|type=unique}} <span style="display:block;

margin-left: Expression error: Unrecognized punctuation character "{".px; margin-bottom: Expression error: Unrecognized punctuation character "{".px; ">[[File:Building_{{#replace:embassy|-|_}}.png|Expression error: Unrecognized punctuation character "{".px|link=Unique buildings#Embassy Complex|Embassy Complex]]

{{building|gaiaseeders 4|Gaia Seeder Outpost|w=60px|type=holding}} <span style="display:block;

margin-left: Expression error: Unrecognized punctuation character "{".px; margin-bottom: Expression error: Unrecognized punctuation character "{".px; ">[[File:Building_{{#replace:gaiaseeders 4|-|_}}.png|Expression error: Unrecognized punctuation character "{".px|link=Holdings#Gaia Seeder Outpost|Gaia Seeder Outpost]]

For building icons that do not use "Building" in their file name, the icon or icon type can be used, to either set a custom file or to set a different file prefix.

If icon type is set to holding, it will also link to the Holdings page by default unless overwritten with type parameter.

Wikitext Produces
{{building|Ministry of Energy|w=60px|type=holding|icon=Holding energy requisitorium}} <span style="display:block;

margin-left: Expression error: Unrecognized punctuation character "{".px; margin-bottom: Expression error: Unrecognized punctuation character "{".px; ">Ministry of Energy

{{building|energy requisitorium|Ministry of Energy|w=60px|icon type=holding}} <span style="display:block;

margin-left: Expression error: Unrecognized punctuation character "{".px; margin-bottom: Expression error: Unrecognized punctuation character "{".px; ">[[File:holding_{{#replace:energy requisitorium|-|_}}.png|Expression error: Unrecognized punctuation character "{".px|link=Holdings#Ministry of Energy|Ministry of Energy]]