Difference between revisions of "Template:Recipe fetch"

From Captain of Industry Wiki
Jump to: navigation, search
m (typo)
(attempt to segregate production and consumption recipes based on the dir param value received)
Line 1: Line 1:
{{#if: {{NAMESPACE}} ||  
{{#if: {{NAMESPACE}} ||  
{{#vardefine: criteria | {{{1|{{PAGENAME}}}}} }}
{{#vardefine: ingred | {{{1|{{PAGENAME}}}}} }}
 
{{#cargo_query: tables=recipes
{{#cargo_query: tables=recipes
| fields = _pageName=Building,
| fields = _pageName=Building,
Line 9: Line 10:
             Output4Name, Output4Qty, Output5Name, Output5Qty, Output6Name, Output6Qty
             Output4Name, Output4Qty, Output5Name, Output5Qty, Output6Name, Output6Qty


| where = Input1Name = "{{#var:criteria}}" OR Input2Name = "{{#var:criteria}}" OR Input3Name = "{{#var:criteria}}"
| where =  
      OR Input4Name = "{{#var:criteria}}" OR Input5Name = "{{#var:criteria}}" OR Input6Name = "{{#var:criteria}}"
  {{#ifeq: {{lc:{{{dir|}}}}} | in |
      OR Output1name = "{{#var:criteria}}" OR Output2Name = "{{#var:criteria}}" OR Output3Name = "{{#var:criteria}}"
    Input1Name = "{{#var:ingred}}" OR Input2Name = "{{#var:ingred}}" OR Input3Name = "{{#var:ingred}}"
      OR Output4Name = "{{#var:criteria}}" OR Output5Name = "{{#var:criteria}}" OR Output6Name = "{{#var:criteria}}"
    OR Input4Name = "{{#var:ingred}}" OR Input5Name = "{{#var:ingred}}" OR Input6Name = "{{#var:ingred}}" |
 
    {{#ifeq: {{lc:{{{dir|}}}}} | out |
      Output1name = "{{#var:ingred}}" OR Output2Name = "{{#var:ingred}}" OR Output3Name = "{{#var:ingred}}"
      OR Output4Name = "{{#var:ingred}}" OR Output5Name = "{{#var:ingred}}" OR Output6Name = "{{#var:ingred}}" |
 
        Input1Name = "{{#var:ingred}}" OR Input2Name = "{{#var:ingred}}" OR Input3Name = "{{#var:ingred}}"
        OR Input4Name = "{{#var:ingred}}" OR Input5Name = "{{#var:ingred}}" OR Input6Name = "{{#var:ingred}}"
        OR Output1name = "{{#var:ingred}}" OR Output2Name = "{{#var:ingred}}" OR Output3Name = "{{#var:ingred}}"
        OR Output4Name = "{{#var:ingred}}" OR Output5Name = "{{#var:ingred}}" OR Output6Name = "{{#var:ingred}}" }} }}


| intro = {{#ifeq: {{lc:{{{dir|}}}}} | in | Consumption | {{#ifeq: {{lc:{{{dir|}}}}} | out | Production}} }}
| format = template
| format = template
| template = Recipe draw
| template = Recipe draw

Revision as of 08:53, 29 January 2022