Difference between revisions of "Template:Ask/Main"

From Wikispooks
Jump to navigation Jump to search
m (Text replacement - "has cause" to "has perpetrator")
(fix |sort & |order params)
Line 48: Line 48:
 
}}|{{#if: {{#titleparts: {{{properties}}} | 1 }}|{{#ask: {{{expression}}} |sort={{{sort|}}} |order={{{order|}}} |mainlabel={{{mainlabel|}}}|format=table
 
}}|{{#if: {{#titleparts: {{{properties}}} | 1 }}|{{#ask: {{{expression}}} |sort={{{sort|}}} |order={{{order|}}} |mainlabel={{{mainlabel|}}}|format=table
 
|?{{#titleparts: {{{properties}}}|1|1}}={{#titleparts: {{{headers}}}|1|1}}
 
|?{{#titleparts: {{{properties}}}|1|1}}={{#titleparts: {{{headers}}}|1|1}}
}}|{{#ask: {{{expression}}} |mainlabel={{{mainlabel|}}}|format=table}}
+
}}|{{#ask: {{{expression}}} |sort={{{sort|}}} |order={{{order|}}} |mainlabel={{{mainlabel|}}}|format=table}}
 
}}}}}}}}}}}}}}</includeonly>
 
}}}}}}}}}}}}}}</includeonly>

Revision as of 15:28, 17 September 2014

Not to be confused with the parser function, #Ask: from Semantic MediaWiki, this template calls that one, but as a template it is more flexible in allowing a variable number of columns.
Example Usage:


{{ask
|expression= [[Constitutes::{{PAGENAME}}]] OR [[DocType::{{PAGENAME}}]] OR [[DocType::{{Uncapitalize|{{PAGENAME}}}}]]
|mainlabel=Example
|format=table
|sort=Started
|order=desc
|properties=Started/ON has perpetrator/Has cause/Description
|headers=Date/Attributed to/Perpetrator(s)/Description
}}

Currently supports up to 7 columns specified by |properties and |headers, as a /-separated list