Template:Creature navbox query: Difference between revisions

From Caves of Qud Wiki
Jump to navigation Jump to search
(This change caused all ~20ish dynamic turrets to stop showing up in the Robot navbox. That seems worse than having a wrong apple farmer link. Undo revision 40655 by Teamtoto (talk))
(Undo revision 40782 by Egocarib (talk) turret ids are all unique so this should be ok now)
Line 2: Line 2:
|q?tables=CreatureFactions=CF,GeneralData=GD,ExtraInfo=EI
|q?tables=CreatureFactions=CF,GeneralData=GD,ExtraInfo=EI
|q?join=CF._pageName=GD._pageName, CF._pageName=EI._pageName
|q?join=CF._pageName=GD._pageName, CF._pageName=EI._pageName
|q?fields=GD.PlainName=Page
|q?fields=GD.ObjectID=Page
|q?where=Faction='{{#replace:{{{1|}}}|'|\'}}' AND GD._pageNamespace ='0' {{#switch:{{{2|_NULL_}}}|common= AND (EI.Info NOT LIKE "%Unique,%" OR EI.Info IS NULL)|unique= AND EI.Info LIKE "%Unique,%"|}}{{#if:{{{category|}}}|AND GD.Categories = '{{{category}}}'}}{{#if:{{{notcategory|}}}|AND (GD.Categories IS NULL OR GD.Categories <> '{{{notcategory}}}')}}
|q?where=Faction='{{#replace:{{{1|}}}|'|\'}}' AND GD._pageNamespace ='0' {{#switch:{{{2|_NULL_}}}|common= AND (EI.Info NOT LIKE "%Unique,%" OR EI.Info IS NULL)|unique= AND EI.Info LIKE "%Unique,%"|}}{{#if:{{{category|}}}|AND GD.Categories = '{{{category}}}'}}{{#if:{{{notcategory|}}}|AND (GD.Categories IS NULL OR GD.Categories <> '{{{notcategory}}}')}}
|q?groupBy=CF._pageName
|q?groupBy=GD.ObjectID
|template=favilink
|template=favilink id
|delimiter=&nbsp;-&#160;</span><span style="display:inline-block">}}</span></includeonly><noinclude>[[Category:Query Templates]]
|delimiter=&nbsp;-&#160;</span><span style="display:inline-block">}}</span></includeonly><noinclude>[[Category:Query Templates]]
A query that returns all creatures favilinked within a faction, delimited by hyphens. First argument must be the faction name.
A query that returns all creatures favilinked within a faction, delimited by hyphens. First argument must be the faction name.

Revision as of 17:33, 5 February 2021

A query that returns all creatures favilinked within a faction, delimited by hyphens. First argument must be the faction name.

argument value returns
2 common returns all common creatures (not unique)
unique returns all unique creatures
category <Category Name> returns all creatures in the specified category
notcategory <Category Name> returns all creatures NOT in the specified category

By default, all creatures will be returned together regardless of unique status or category.