Difference between revisions of "Template:Ask/Main"

From Wikispooks
Jump to navigation Jump to search
(working?)
(fix...)
Line 9: Line 9:
 
|headers=Date/Attributed to/Perpetrator(s)/Description ... A matching /-separated list of column captions
 
|headers=Date/Attributed to/Perpetrator(s)/Description ... A matching /-separated list of column captions
 
}}</nowiki></poem></noinclude><includeonly>
 
}}</nowiki></poem></noinclude><includeonly>
{{#if: {{#titleparts: {{{properties}}} | 7 }}|{{#ask: {{{expr}}} |mainlabel={{{mainlabel|}}}|format=table
+
{{#if: {{#titleparts: {{{properties}}} | -7 }}|{{#ask: {{{expr}}} |mainlabel={{{mainlabel|}}}|format=table
 
|?{{#titleparts: {{{properties}}}|1|1}}={{#titleparts: {{{headers}}}|1|1}}
 
|?{{#titleparts: {{{properties}}}|1|1}}={{#titleparts: {{{headers}}}|1|1}}
 
|?{{#titleparts: {{{properties}}}|1|2}}={{#titleparts: {{{headers}}}|1|2}}
 
|?{{#titleparts: {{{properties}}}|1|2}}={{#titleparts: {{{headers}}}|1|2}}
Line 18: Line 18:
 
|?{{#titleparts: {{{properties}}}|1|7}}={{#titleparts: {{{headers}}}|1|7}}
 
|?{{#titleparts: {{{properties}}}|1|7}}={{#titleparts: {{{headers}}}|1|7}}
 
}}|
 
}}|
{{#if: {{#titleparts: {{{properties}}} | 6 }}|{{#ask: {{{expr}}} |mainlabel={{{mainlabel|}}}|format=table
+
{{#if: {{#titleparts: {{{properties}}} | -6 }}|{{#ask: {{{expr}}} |mainlabel={{{mainlabel|}}}|format=table
 
|?{{#titleparts: {{{properties}}}|1|1}}={{#titleparts: {{{headers}}}|1|1}}
 
|?{{#titleparts: {{{properties}}}|1|1}}={{#titleparts: {{{headers}}}|1|1}}
 
|?{{#titleparts: {{{properties}}}|1|2}}={{#titleparts: {{{headers}}}|1|2}}
 
|?{{#titleparts: {{{properties}}}|1|2}}={{#titleparts: {{{headers}}}|1|2}}

Revision as of 16:20, 31 December 2013

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.
Usage:


{{ask
|expr= [[Constitutes::{{PAGENAME}}]] OR [[DocType::{{PAGENAME}}]] OR [[DocType::{{Uncapitalize|{{PAGENAME}}}}]]
|mainlabel=Example
|format=table
|properties=Started/ON has cause/Has cause/Description ... Up to 7 properties, separated by / characters
|headers=Date/Attributed to/Perpetrator(s)/Description ... A matching /-separated list of column captions
}}