Template:Creature navbox query: Difference between revisions

From Caves of Qud Wiki
Jump to navigation Jump to search
m (fixed weird spacing)
(attempt to add some category filtering)
Line 3: Line 3:
|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.PlainName=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,%"|}}
|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=CF._pageName
|template=favilink
|template=favilink
Line 9: Line 9:
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.
{|class="wikitable"
{|class="wikitable"
!second argument
!argument
!value
!returns
!returns
|-
|-
!common
|rowspan="2"|'''2'''
|common
|returns all common creatures (not unique)
|returns all common creatures (not unique)
|-
|-
!unique
|unique
|returns all unique creatures
|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.
By default, all creatures will be returned together regardless of unique status or category.
</noinclude>
</noinclude>

Revision as of 15:52, 8 December 2020

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.