Template:Buildingbox

From Against the Storm Official Wiki
Revision as of 04:48, 9 November 2023 by Aeredor (talk | contribs) (Created for infoboxes on buildings' pages)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)


Template:Shopbox

Shopbox is a template that creates an infobox on the page by displaying data provided by template parameters and loading data from the data template Template:Workshops_csv. The infobox to the right on this page is an example.

Overview

This template should be used for all Production Buildings on the wiki, that is, buildings whose recipes convert goods into other goods. The template requires only the name parameter, which tells the code behind the scenes which building you want an infobox for.

In the future, this template could be augmented to automatically create categories based on the information retrieved. For example, the infobox for the Cookhouse could add categories for food production, complex food, crafting materials, large buildings, or even 2-star buildings.

Parameters

Only the first, name is required, and it must be spelled correctly to match the in-game name of the building. Other parameters are optional, but add to the value of displaying the infobox.

Parameter Type Description
name string Required. The in-game name of the building for which you want to display the infobox. Will also serve as the header of the box.

Errors

When the template is called without a name, the template reminds you that it is required.

Example:

{{Shopbox}}

Yields:

Template:Shopbox

When providing the name of a building, it is important that it is spelled correctly, including any punctuation. Otherwise, an error will return from the data module.

Example:

Broken: {{Shopbox|name=Alchemist Hut}}

Template:Shopbox

Fixed: {{Shopbox|name=Alchemist's Hut}}

Template:Shopbox