Module:Materials/Data/doc
This is the documentation page for Module:Materials/Data
Module documentation (view)
Usage
This is the subpage for Module:Materials, and stores the data needed for the module to function and outputs the material.
Inserting a new source/availability
["name_of_material"] = { "material_image", "material_image_size", "link_to_material", "name_of_material", "special_text_for_material" }
When adding a new smaterial to be used on pages, the following syntax must be inserted into the main data
table on Module:Materials/Data. Note that the table is split between New Horizons and Pocket Camp. Each material added must be added under its appropriate section.
name_of_material
describes the name of the material that the editor will write for the material templates. There is also a second instance ofname_of_material
, which can also feature a different text to its first instance. To use thespecial_text_for_material
parameter for certain instances (e.g. 10 Turnips and Poké Ball, leave the second instance blank.material_image
requires an image (preferably an icon) to be added. It must include the filename extension.material_image_size
describes the default size thatsource_image
will be presented in.link_to_material
describes the link that the player will click on (provided that the link is present). To use thespecial_text_for_material
parameter for certain instances (e.g. 10 Turnips and Poké Ball), leave this blank.special_text_for_material
is optional, and is used to display specialized wikitext.
Example
["Wood"] = { "Wood NH Inv Icon.png", "15px", "Item:Wood (New Horizons)", "Wood", "[[Item:Wood (New Horizons)|Wood]]" }
"Wood" is the name_of_material
in both instances that it appears. "Item:Wood (New Horizons)" is the link_to_material
and has a special wikitext presented in special_text_for_material
, although it will be unused in this instance. Its material_image
is "Wood NH Inv Icon.png", and the material_image_size
is set to "15px".
The data is under the materialNH
table, so the data can be accessed by the {{Material}} template.
The output is: Wood
["Cotton"] = { "Cotton PC Icon.png", "20px", "", "", "Cotton" }
"Cotton" is the name_of_material
, but it is blank in its second instance, along with its link_to_material
. Its material_image
is "Cotton PC Icon.png", and the material_image_size
is set to "20px". Its special_text_for_material
is simply "Cotton", and will provide no links at all.
The data is under the materialPC
table, so the data can be accessed by the {{PC Material}} template.
The output is: Cotton