Difference between revisions of "Template:BoM"
(added more info) |
|||
Line 1: | Line 1: | ||
{{#vardefine: recipeSource|{{{source|{{PAGENAME}} }}} }}<!-- | {{#vardefine: recipeSource|{{{source|{{PAGENAME}} }}} }}<!-- | ||
− | -->{{#vardefine: resourceList|}}<includeonly> | + | -->{{#vardefine: resourceList|}}<includeonly><!-- |
− | {{# | + | -->{{#switch: {{{mode}}} |
− | + | | tree | all = {{#ask: | |
− | + | [[-Has subobject::{{#var: recipeSource}}]] [[Crafting ingredient.ItemType::+]] | |
− | + | |mainlabel=- | |
− | + | |headers=hide | |
− | + | |format=template | |
− | + | |template=ResourceBreakdown | |
− | + | |userparam=0;1 | |
− | + | |sort=Qty,Crafting ingredient | |
− | + | |order=desc,asc | |
− | + | |?Crafting ingredient | |
− | }} }} | + | |?Qty |
− | {{#ask: | + | }} |
− | + | }}<!-- | |
− | + | -->{{#switch: {{{mode}}} | |
− | + | | list | all = {{#vardefine: resourceList | |
− | + | | {{#ask: | |
− | + | [[-Has subobject::{{#var: recipeSource}}]] [[Crafting ingredient.ItemType::+]] | |
− | + | |mainlabel=- | |
− | + | |headers=hide | |
− | + | |format=template | |
− | + | |template=ResourceBreakdown | |
− | + | |userparam=0;1 | |
− | }} | + | |sort=Qty,Crafting ingredient |
− | </includeonly><noinclude> | + | |order=desc,asc |
+ | |?Crafting ingredient | ||
+ | |?Qty | ||
+ | }} | ||
+ | }} | ||
+ | }}<!-- | ||
+ | --></includeonly><noinclude> | ||
Generates a BoM (Bill of Materials) for an item. Has three modes: | Generates a BoM (Bill of Materials) for an item. Has three modes: | ||
* Show the most basic resources with all amounts added up. (WIP, not possible without semantic wiki [https://www.mediawiki.org/wiki/Extension:Arrays array] extension) | * Show the most basic resources with all amounts added up. (WIP, not possible without semantic wiki [https://www.mediawiki.org/wiki/Extension:Arrays array] extension) |
Revision as of 13:44, 5 September 2018
Generates a BoM (Bill of Materials) for an item. Has three modes:
- Show the most basic resources with all amounts added up. (WIP, not possible without semantic wiki array extension)
- Show a tree style list with all the needed resources as child of the intermediate ingredient with different levels of indentation (done)
- Show both