Template:Recipe/doc
This template calls renderRecipe
in Module:RenderRecipe to get recipes for a product and/or a building. This will generate a new wikitable full of content from the game: buildings, stars of efficiency, ingredients, and products.
This template standardizes the display of recipes throughout this wiki and greatly simplifies the amount of writing that is necessary when adding new content pages, especially for resources and buildings.
Usage
The table will contain exactly one recipe if the template is given both a product and building. The table will (usually) contain more than one row if the template is given either a product or a building. If nothing is provided, for example {{Recipe}}
, an error will appear instead.
Here are ways to call the template, as they would be written in the article calling the template:
Argument | Examples | Expected outcome |
---|---|---|
None | {{Recipe}}
|
An error |
Product and building | {{Recipe|Crystalized Dew|Brickyard}} {{Recipe|product=Crystalized Dew|building=Brickyard}}
|
A table with one row. |
Product only | {{Recipe|Pie}} {{Recipe|product=Pie}}
|
A table with several rows, one for each building in which Pie can be produced. |
Building only | {{Recipe||Scribe}} (note the double pipe) {{Recipe|building=Scribe}}
|
A table with several rows, one for each product that can be produced in the Scribe. |
Examples
The following are generated by calling the template, as shown in the examples in the table above.
{{Recipe}}
yields:
Lua error in Module:RecipeController at line 160: You must specify a product, building, or ingredient. Please see the template documentation for how to use the parameters.
{{Recipe|Crystalized Dew|Brickyard}}
yields:
Building | Grade | Ingredient #1 | Ingredient #2 | Ingredient #3 | Product | |||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
★ 0:42 |
|
|
|
2 |
{{Recipe|Pie}}
yields:
Building | Grade | Ingredient #1 | Ingredient #2 | Product | |||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
★ 2:06 |
|
|
10 | |||||||||||||||||
|
★★ 2:06 |
|
|
10 | |||||||||||||||||
|
★★★ 1:45 |
|
|
10 |
{{Recipe||Scribe}}
yields:
Building | Grade | Ingredient #1 | Ingredient #2 | Product | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
★ 2:06 |
|
|
10 Ale | |||||||||||||
|
★★★ 1:03 |
|
|
8 Scrolls | |||||||||||||
|
★★ 0:42 |
— |
|
2 Pack of Trade Goods |