Template:Food that grants: Difference between revisions

From Caves of Qud Wiki
Jump to navigation Jump to search
(fix query)
(support nobullets option)
Line 1: Line 1:
<includeonly><ul><li>{{#invoke:CargoQuery|main
<includeonly>{{#ifeq: {{{2|}}} | nobullets | |<ul><li>}}{{#invoke:CargoQuery|main
|q?tables=Food, GeneralData
|q?tables=Food, GeneralData
|q?join=Food._pageName=GeneralData._pageName
|q?join=Food._pageName=GeneralData._pageName
Line 5: Line 5:
|q?where=CookEffect HOLDS LIKE '%{{{1|}}}%' AND Food._pageNamespace = '0'
|q?where=CookEffect HOLDS LIKE '%{{{1|}}}%' AND Food._pageNamespace = '0'
|template=favilink
|template=favilink
|delimiter=<li>
|delimiter={{#ifeq: {{{2|}}} | nobullets |<br>|<li>}}
|default=No Results!
|default=No Results!
}}
}}
</ul></includeonly><noinclude>[[Category:Query Templates]]
{{#ifeq: {{{2|}}} | nobullets | |</ul>}}</includeonly><noinclude>[[Category:Query Templates]]
Template that returns a bulleted list of all food items that grant the specified cooking effect provided in the first argument. This uses <code>LIKE</code>, so as long as the first argument contains the word, it will return.
Template that returns a bulleted list of all food items that grant the specified cooking effect provided in the first argument. This uses <code>LIKE</code>, so as long as the first argument contains the word, it will return.


Example:
==Basic example==
<pre>{{Food that grants|Heat}}</pre>
<pre>{{Food that grants|Heat}}</pre>
Output:
Output:
{{Food that grants|Heat}}</noinclude>
{{Food that grants|Heat}}
 
==Example with no bullets==
<pre>{{Food that grants|Heat|nobullets}}</pre>
Output:
 
{{Food that grants|Heat|nobullets}}</noinclude>

Revision as of 02:52, 19 August 2020

Template that returns a bulleted list of all food items that grant the specified cooking effect provided in the first argument. This uses LIKE, so as long as the first argument contains the word, it will return.

Basic example

{{Food that grants|Heat}}

Output:

Example with no bullets

{{Food that grants|Heat|nobullets}}

Output:

congealed blaze
cured dawnglider tail
fire ant gaster paste