Many thanks to our Patrons who cover ~2/3 of our hosting bill. Please join them if you can.
Difference between revisions of "Template:Ask/Main"
Jump to navigation
Jump to search
m (Text replacement - "has cause" to "has perpetrator") |
m (Robin moved page Template:Ask to Template:Ask/Main without leaving a redirect: Wrapping this in another level) |
||
(2 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
− | <noinclude>'''Not to be confused with the parser function, #Ask: from | + | <noinclude>'''Not to be confused with the parser function, [https://semantic-mediawiki.org/wiki/Help:Inline_queries#Parser_function_.23ask #Ask:] from {{SMW}}, this template calls that one, but as a template it is more flexible in allowing a variable number of columns.'''<br/> |
Example Usage:<br/> | Example Usage:<br/> | ||
<poem><font face="courier"><nowiki> | <poem><font face="courier"><nowiki> | ||
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> |
Latest revision as of 08:09, 8 July 2016
Not to be confused with the parser function, #Ask: from SMW, 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