Template:Goodbox: Difference between revisions
(Created for infoboxes on goods' pages) |
(Updated to new infobox styles, information, etc. for resources.) |
||
(3 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
<includeonly>{{#invoke: Goodbox| | <includeonly>{{#invoke: Goodbox|main | ||
| name= {{{name| {{{1|}}} }}} | | name= {{{name| {{{1|}}} }}} | ||
}} | |||
</includeonly> | |||
<includeonly>[[Category:Goods]]</includeonly><noinclude> | |||
{{Goodbox|name=Parts}} | {{Goodbox|name=Parts|purpose=This is an example infobox}} | ||
'''Goodbox''' 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:Goods_csv]]. The infobox to the right on this page is an example. | '''Goodbox''' 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:Goods_csv]]. The infobox to the right on this page is an example. |
Latest revision as of 14:33, 12 October 2024
Parts
Building Materials
Rare elements used in camp construction. Difficult to produce in this harsh environment.
Recipes
- Rainpunk Foundry (★★★)
ID = `[Mat Processed] Parts`
Goodbox 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:Goods_csv. The infobox to the right on this page is an example.
Overview
This template should be used for all Goods on the wiki. The template requires only the name
parameter, which tells the code behind the scenes which Good 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 Parts could add categories for building materials, rare goods, or even goods that are at the end of their production chain.
Parameters
Only the first, name
is required, and it must be spelled correctly to match the in-game name of the good. 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 good for which you want to display the infobox. Will also serve as the header of the box. |
purpose | string | The overall purpose of the good, such as "Services" or "Complex Food" or omit this parameter. For example, if the purpose is "Crafting," the infobox will already show "Crafting Resources" for the good's ``Category,`` so you may omit it. |
species_preference | string | For goods that are consumed by villagers, write which species prefers this good. For example, Biscuits are preferred by "Beaver, Harpy, Human." |
Errors
When the template is called without a name, the template reminds you that it is required.
Example:
{{Goodbox}}
Yields:
Lua error in Module:GoodsData at line 257: Parameter is nil or empty for the good's name..
When providing the name of a good, it is important that it is spelled correctly, including any punctuation. Otherwise, an error will return from the data module.
Example:
Broken: {{Goodbox|name=PlantFibre}}
Lua error in Module:Goodbox at line 142: No resource found with name: PlantFibre..
Fixed: {{Goodbox|name=Plant Fiber}}
Plant Fiber
Crafting Resources
"Used for crafting. Obtained in: Homestead, Plantation, Harvesters' Camp"
Recipes
- Harvesters' Camp (★★)
- Plantation (★★)
- Homestead (★★★)
ID = `[Mat Raw] Plant Fibre`