Template:Recipe
Generates recipe tables. Use this wherever you need to show how to use Goods, Services, or Buildings.
Overview
Create a concise, sortable table using game data to show in-game recipes. The table mimics the layout of the in-game recipe browser, with the building, efficiency of the recipe, number of ingredients, and the product (or service). Optionally, outputs just a list of buildings (or products or services at a building) with their efficiency stars.
Links to Resource Pages
Links within the table point to the product's or service's page and the anchor corresponding to its location in the table. Goods in ingredients columns will point to the recipes where that good is a product, so you can see where it comes from. Goods in the product column will point to the recipes where that good is an ingredient, so you can see where it can be used.
Parameters
At least one of these is required. If the names provided are not spelled correctly (including punctuation), matching their in-game names, the recipe will return an error.
Parameter | Type | Description |
---|---|---|
product | string | The name of the product or service associated with the recipe. Can be used in conjunction with building to display exactly one recipe.
|
building | string | The name of the building where the recipe is produced. Can be used in conjunction with product to display exactly one recipe.
|
ingredient | string | The name of an ingredient in a recipe. May result in a very long table. |
display | "list" | If display=list is present at the end of the template call, it overrides the default use of a wikitable to display the recipe. Instead, it will produce a list of buildings with their efficiency stars, each on their own line, without any ingredients or product or service names or icons. Or, if you've specified the building, it displays a list of products with their efficiency stars. Useful for populating larger tables or between paragraphs where displaying the entire recipe isn't relevant.
|
Errors
When a product, service, building, or ingredient is not spelled correctly or is not a valid name, the template returns an error message to help you locate the spelling or name mistake.
Example:
Broken: {{Recipe|building=Alchemists' Hut}}
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.
Fixed: {{Recipe|building=Alchemist's Hut}}
Building | Grade | Ingredient #1 | Ingredient #2 | Ingredient #3 | Product | |||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
★★ 1:24 |
— |
|
|
10 Wine | |||||||||||||||||||||||
|
★★ 2:06 |
|
|
|
10 Tea | |||||||||||||||||||||||
|
★★ 0:42 |
|
|
|
2 Crystalized Dew |
There may be cases where the name you should use to look up a good or building is not the right name. Please post these to this template's discussion page.
Examples
Basic Usage for Products and Buildings
A standard use of the template to show exactly one recipe for a product or service, in one building:
{{Recipe|Crystalized Dew|Brickyard}}
Yields:
Building | Grade | Ingredient #1 | Ingredient #2 | Ingredient #3 | Product | |||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
★ 0:42 |
|
|
|
2 |
Alternatively, for a service building:
{{Recipe|Leisure|Tavern}}
Yields:
Building | Grade | Ingredient | Product | |||
---|---|---|---|---|---|---|
|
★ 0:00 |
|
1 |
Here are several ways to call the template for products and buildings.
Parameter(s) | Example(s) | Expected outcome |
---|---|---|
no parameters | {{Recipe}} |
an error |
product (or service) and building | {{Recipe|Crystalized Dew|Brickyard}} {{Recipe|product=Crystalized Dew|building=Brickyard}}
|
A table with exactly one row. |
product (or service) only | {{Recipe|Pie}} {{Recipe|product=Pie}}
|
A table with several rows, one for each building in which Pie can be produced. |
building only | {{Recipe||Market}} (note the double pipe) {{Recipe|building=Market}}
|
A table with several rows, one for each service provided by the Market. |
product (or service), but with output override | {{Recipe|Crystalized Dew|display=list}}
|
A short list of buildings and their efficiency stars that easily fit within another table:
|
Ingredients
Unlike when specifying the product (or service) and/or building, when you specify the ingredient, you explicitly must name the parameter with ingredient=
in the template. Currently, you cannot select both a product and an ingredient (for example, all recipes where Berries are the ingredient and Pie is the product), because this is redundant with the product parameter by itself (since there is currently only one arrangement of ingredients and options that will make a product).
The results of specifying the ingredient without also filtering on a building can display a long table. But on a resource's page, this information is expected to be valuable.
{{Recipe|ingredient=Wine}}
Yields:
Building | Grade | Ingredient #1 | Ingredient #2 | Product | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
★ 0:00 |
— |
|
1 Luxury | ||||||||||||||
|
★ 1:24 |
|
|
8 Scrolls | ||||||||||||||
|
★★ 1:24 |
|
|
8 Scrolls | ||||||||||||||
|
★★★ 1:03 |
|
|
8 Scrolls | ||||||||||||||
|
★ 0:42 |
— |
|
2 Pack of Luxury Goods | ||||||||||||||
|
★★ 0:42 |
— |
|
2 Pack of Luxury Goods | ||||||||||||||
|
★★★ 0:28 |
— |
|
2 Pack of Luxury Goods |
{{Recipe|building=Lumber Mill|ingredient=Wine}}
Yields:
Building | Grade | Ingredient #1 | Ingredient #2 | Product | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
★ 1:24 |
|
|
8 Scrolls |
Further Examples and Errors
The following are generated by calling the template as shown in the parameter examples table above.
1. product and building:
{{Recipe|Crystalized Dew|Brickyard}}
Yields:
Building | Grade | Ingredient #1 | Ingredient #2 | Ingredient #3 | Product | |||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
★ 0:42 |
|
|
|
2 |
2. product only
{{Recipe|Pie}}
Yields:
Building | Grade | Ingredient #1 | Ingredient #2 | Product | |||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
★ 2:06 |
|
|
10 | |||||||||||||||||
|
★★ 2:06 |
|
|
10 | |||||||||||||||||
|
★★★ 1:45 |
|
|
10 |
3. building only
{{Recipe|building=Market}}
Yields:
Building | Grade | Ingredient | Product | |||
---|---|---|---|---|---|---|
|
★ 0:00 |
|
1 Leisure | |||
|
★ 0:00 |
|
1 Treatment |
4. with the output override
{{Recipe|Crystalized Dew|display=list}}
Yields:
- Forester's Hut (★★)
- Alchemist's Hut (★★)
- Beanery (★)
- Brickyard (★)
5 with the output override but specifying a building
{{Recipe|building=Beanery|display=list}}
Yields:
- Porridge (★★★)
- Pickled Goods (★)
- Crystalized Dew (★)
The following are error states generated by calling the template incorrectly.
6. with no parameters
{{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.
7. using only one pipe and not specifying that the provided name is the building
{{Recipe|Scribe}}
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.
8. asking for products or buildings with no recipes
{{Recipe|building=Small Warehouse}}
Yields:
No recipes. |
---|