Template:Recipe: Difference between revisions
(added another example) |
(added support for using the template to get all recipes at a building with no product specified) |
||
Line 1: | Line 1: | ||
{{#invoke:RenderRecipe|renderRecipe|product={{{1}}}|building={{{2|}}}}}<noinclude> | {{#invoke:RenderRecipe|renderRecipe|product={{{1|}}}|building={{{2|}}}}}<noinclude> | ||
This template calls renderRecipe, which | This template calls renderRecipe, which writes out either ONE recipe if the product and building is specified, ALL recipes for the specified product, or ALL recipes at a specified building. | ||
For example: <code><nowiki>{{Recipe|Biscuits|Cookhouse}}</nowiki></code> yields: | For example: <code><nowiki>{{Recipe|Biscuits|Cookhouse}}</nowiki></code> yields: | ||
{{Recipe| | {{Recipe|Coal|Kiln}} | ||
And another example: <code><nowiki>{{Recipe|Meat}}</nowiki></code> yields: | And another example: <code><nowiki>{{Recipe|Meat}}</nowiki></code> yields: | ||
{{Recipe| | {{Recipe|Skewers}} | ||
And a final example: <code><nowiki>{{Recipe|Biscuits}}</nowiki></code> yields: | And a final example: <code><nowiki>{{Recipe|Biscuits}}</nowiki></code> yields: | ||
{{Recipe| | {{Recipe||Scribe}} | ||
</noinclude> | </noinclude> |
Revision as of 04:46, 9 February 2023
RenderRecipe error: Invalid template parameters. This template requires at least a product or building.
This template calls renderRecipe, which writes out either ONE recipe if the product and building is specified, ALL recipes for the specified product, or ALL recipes at a specified building.
For example: {{Recipe|Biscuits|Cookhouse}}
yields:
Lua error in Module:RenderRecipe at line 106: attempt to call field 'getRecipeAtBuilding' (a nil value).
And another example: {{Recipe|Meat}}
yields:
Lua error in Module:RenderRecipe at line 120: attempt to call field 'getRecipeForProduct' (a nil value).
And a final example: {{Recipe|Biscuits}}
yields:
Lua error in Module:RenderRecipe at line 142: attempt to call field 'getBuildingsRecipes' (a nil value).