Template:Creatures with the item: Difference between revisions

From Caves of Qud Wiki
Jump to navigation Jump to search
m (ah the inventory table was punked)
(Replace default with more helpful message, small doc)
 
(6 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<includeonly>
<includeonly>{{#invoke:cargoQuery|main
<ul>
|tables = GeneralData=GD,Inventory=I
<li>
|join on = GD.JoinKey= I.JoinKey
{{#cargo_query
|fields = {{favilink format args}}
:tables = GeneralData,Inventory
|where = I.Item = '{{{1|{{PAGENAME}}}}}'
|join = GeneralData._pageID = Inventory._pageID
|format = ul
|fields = GeneralData.PlainName = Page
|template = favilink format
|where = BINARY Inventory.Item = '{{PAGENAME}}'
|default = No creatures spawn with {{{1|{{PAGENAME}}}}}.
|template = favilink
}}</includeonly><noinclude>[[Category:Query Templates]]
|default = {{{1}}}
This template takes an optional one argument, which returns anything with the specified item page name. Leaving it blank will default to the page name the template was invoked on.
|delimiter = <li>
 
}}
== Usage ==
</li>
<pre>{{Creatures with the item|Desert rifle}}</pre>
</ul>
{{Creatures with the item|Desert rifle}}
</includeonly>
</noinclude>
<noinclude>[[Category:Query Templates]]</noinclude>

Latest revision as of 13:42, 13 August 2021

This template takes an optional one argument, which returns anything with the specified item page name. Leaving it blank will default to the page name the template was invoked on.

Usage

{{Creatures with the item|Desert rifle}}

No creatures spawn with Desert rifle.