Template:Food that grants: Difference between revisions

From Caves of Qud Wiki
Jump to navigation Jump to search
(update doc, and also this doesnt use LIKE anymore)
(compound query with liquids)
Line 1: Line 1:
<includeonly>{{#ifeq: {{{2|list}}}| list | <ul><li> }}{{#invoke:CargoQuery|main
<includeonly>{{#ifeq: {{{2|list}}}| list | <ul><li> }}<!--
|tables=Food, GeneralData
-->{{#cargo_compound_query:tables=Food=F
|join=Food._pageName=GeneralData._pageName
;fields=F._pageName=Page
|fields=PlainName=Page
;where=F.CookEffect HOLDS '{{{1|}}}' AND F._pageNamespace = '0'
|where=CookEffect HOLDS '{{{1|}}}' AND Food._pageNamespace = '0'
;default=No Results!
|template=favilink
|tables=Liquids=L
|delimiter={{#switch: {{{2|list}}} |list=<li> |linebreaks=<br> |,<nowiki> </nowiki> }}
;fields=L._pageName=Page
|default=No Results!
;where=L.CookEffect HOLDS '{{{1|}}}' AND L._pageNamespace = '0'
;default=No Results!
|format=template
|template=favilink page
|delimiter = {{#switch: {{{2|list}}} |list=<li> |linebreaks=<br> |,<nowiki> </nowiki> }}
}}
}}
{{#ifeq: {{{2|list}}} | list | </ul> }}</includeonly><noinclude>[[Category:Query Templates]]
{{#ifeq: {{{2|list}}} | list | </ul> }}</includeonly><noinclude>[[Category:Query Templates]]

Revision as of 18:29, 1 September 2020

Template that returns a bulleted list of all food items that grant the specified cooking effect provided in the first argument.

Default example

{{Food that grants|Heat and fire-based}}

Output:

Example with linebreaks instead of bullets

{{Food that grants|Heat and fire-based|linebreaks}}

Output:
congealed blaze
cured dawnglider tail
fire ant gaster paste

Example with commas

{{Food that grants|Heat and fire-based|commas}}

Output:

congealed blaze, cured dawnglider tail, fire ant gaster paste