Template:Recipes/doc

Query crafting recipes from database and display them as a table. The original source for the data can be found on the subpages of Recipes.

Usage
Parameters for query constraints:

List only recipes that use these stations.
 * = station1/station2/...

Exclude recipes that use these stations.
 * = station1/station2/...

List only recipes that create this item. It is also possible to do pattern search using SQL LIKE syntax. Example:, multiple:. Note that "LIKE" must be all uppercase.
 * = result1/result2/...

Exclude recipes that create this item. It is also possible to do pattern search using SQL LIKE syntax. Example:, multiple:. Note that "LIKE" must be all uppercase.
 * = result1/result2/...

List only recipes that use these items as ingredients. You can use "Any xxx" as ingredient name for some alternative crafting ingredients groups; and, if you query an item in a substitutable item group, you will get "Any xxx" as well. Adding "#" as a prefix (#xxx) will turn this off for that specific item. For example, if you query by, you will get recipes as if you query by  ;   equals to. It is also possible to do pattern search using SQL LIKE syntax. Example:, multiple:. Note that "LIKE" must be all uppercase.
 * = ingredient1/ingredient2/...

List only recipes that are exclusive to the specified platforms. Please note that this parameter requires full-match. For example, if a recipe is exclusive to desktop and console, you must use (can be in any order) to match it. will not match it.
 * / = platform-platform-platform

NOTE: The relationship between the above parameters is "and", and the relationship of multiple values inside a single parameter is "or". For example,  means (in SQL style):

Raw input string for where the parameter of cargo query is located. If specified, all of above parameters are ignored. Used to write complex queries when necessary, with caution.
 * = whereString

Other parameters:

Adds a title bar to the recipes table, with specified text.

Turn off result & ext cols grouping.
 * = n/no

If set, the Crafting Station column will be hidden.
 * = y

Turn off Crafting Station column grouping. Only valid when  is not set.
 * = n/no

If set, result items will show their internal item IDs (if available).
 * = y

By default, this template will add transcluding page to crafting station category if crafting result is the page title itself. will disable this. will force categorization, no matter what the result and page title are.
 * = no/force

Set to  to stop the result items from linking to their pages.
 * = n/no

Assert the expected number of rows in this crafts table. If the expected and actual number of rows are not equal, this page will be added to Category:Recipes_table_with_unexpected_total_number_of_rows.
 * = number

Makes the table unsortable.
 * = n/no

HTML class/id/style attributes for outer wrapper div element.

Example
This code queries all Bone furniture.

Explanation: Select all recipes that have as an ingredient, and  as a crafting station, then exclude the result. There are 18 items in Bone furniture, so we assert.

Register Recipes
Recipes in database are registered by recipes/register. All recipes should be registered on the corresponding crafting station page ( Recipes/[station] ), e.g. Recipes/Sawmill. For usage of recipes/register, see its documentation.

Custom Result Cells
= template name used for format result cell.

This template will receive the following arguments:
 * ,,  : options for item template used by default display.
 * ,,  ,  ,  ,  ,  : infomation about crafting result.

"@@@@" in template output will be replaced with the default result display.

See Chairs for an example.

Custom Table Header

 * = content of result , default is
 * = content of ingredients , default is
 * = content of crafting station , default is

Adding extra columns/rows around crafting stations
Only valid when  is not set.

Define cols: ... Column headers before crafting station column

... Column headers before crafting station column

Define index key for row content: Define index key for "Furnace"(as  parameter), for example
 * = _a

Define actual contents: ... ... Define contents for  using index key.

Adding extra cols/rows around by crafting results
Define columns: ... ... ... ... The order in which all columns are displayed is: s •  •  s •   •  s •  s •   •  s •  s

Define index key for row content: Define index key for a row(Priority in this order): Define by row number Define by result name + version info Define by result name
 * = _a
 * = _a
 * = _a

Define actual contents: ... Define contents for  using index key, corresponding to the definition of columns.

Adding extra rows
NOTE: extra rows don't count as part of.

Before recipe rows: ... ...

After recipe rows: ... ...

See Bars and Recovery potions for examples.

Extract component
Some components of the recipe can be extracted and formatted separately, see recipes/extract.

Count for result rows
You can use recipes/exist and recipes/count to check the existence and number of results of recipes that meet query constraints. Note: you should use  to check existence instead of  , because the former is much faster and cheaper.

de:Vorlage:Recipes fr:Modèle:Recipes