Difference between revisions of "Template:Ask/Main"

From Wikispooks
Jump to navigation Jump to search
(fix...)
(fix?)
Line 1: Line 1:
 
<noinclude>'''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.'''<br/>
 
<noinclude>'''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.'''<br/>
Usage:<br/>
+
Example Usage:<br/>
<poem><nowiki>
+
<poem><font face="courier"><nowiki>
 
{{ask
 
{{ask
 
|expr= [[Constitutes::{{PAGENAME}}]] OR [[DocType::{{PAGENAME}}]] OR [[DocType::{{Uncapitalize|{{PAGENAME}}}}]]
 
|expr= [[Constitutes::{{PAGENAME}}]] OR [[DocType::{{PAGENAME}}]] OR [[DocType::{{Uncapitalize|{{PAGENAME}}}}]]
 
|mainlabel=Example
 
|mainlabel=Example
 
|format=table
 
|format=table
|properties=Started/ON has cause/Has cause/Description ... Up to 7 properties, separated by / characters
+
|properties=Started/ON has cause/Has cause/Description ...  
|headers=Date/Attributed to/Perpetrator(s)/Description ... A matching /-separated list of column captions
+
|headers=Date/Attributed to/Perpetrator(s)/Description ...
}}</nowiki></poem></noinclude><includeonly>
+
}}</nowiki></poem></font>
 +
Currently support up to 7 columns specified by |properties and |headers, as a /-separated list
 +
</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}}
Line 26: Line 28:
 
|?{{#titleparts: {{{properties}}}|1|6}}={{#titleparts: {{{headers}}}|1|6}}
 
|?{{#titleparts: {{{properties}}}|1|6}}={{#titleparts: {{{headers}}}|1|6}}
 
}}|
 
}}|
{{#if: {{#titleparts: {{{properties}}} | 5 }}|{{#ask: {{{expr}}} |mainlabel={{{mainlabel|}}}|format=table
+
{{#if: {{#titleparts: {{{properties}}} | -5 }}|{{#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 33: Line 35:
 
|?{{#titleparts: {{{properties}}}|1|5}}={{#titleparts: {{{headers}}}|1|5}}
 
|?{{#titleparts: {{{properties}}}|1|5}}={{#titleparts: {{{headers}}}|1|5}}
 
}}|
 
}}|
{{#if: {{#titleparts: {{{properties}}} | 4 }}|{{#ask: {{{expr}}} |mainlabel={{{mainlabel|}}}|format=table
+
{{#if: {{#titleparts: {{{properties}}} | -4 }}|{{#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 39: Line 41:
 
|?{{#titleparts: {{{properties}}}|1|4}}={{#titleparts: {{{headers}}}|1|4}}
 
|?{{#titleparts: {{{properties}}}|1|4}}={{#titleparts: {{{headers}}}|1|4}}
 
}}|
 
}}|
{{#if: {{#titleparts: {{{properties}}} | 3 }}|{{#ask: {{{expr}}} |mainlabel={{{mainlabel|}}}|format=table
+
{{#if: {{#titleparts: {{{properties}}} | -3 }}|{{#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}}
 
|?{{#titleparts: {{{properties}}}|1|3}}={{#titleparts: {{{headers}}}|1|3}}
 
|?{{#titleparts: {{{properties}}}|1|3}}={{#titleparts: {{{headers}}}|1|3}}
 
}}|
 
}}|
{{#if: {{#titleparts: {{{properties}}} | 2 }}|{{#ask: {{{expr}}} |mainlabel={{{mainlabel|}}}|format=table
+
{{#if: {{#titleparts: {{{properties}}} | -2 }}|{{#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}}
 
}}|
 
}}|
{{#if: {{#titleparts: {{{properties}}} | 1 }}|{{#ask: {{{expr}}} |mainlabel={{{mainlabel|}}}|format=table
+
{{#if: {{#titleparts: {{{properties}}} | -1 }}|{{#ask: {{{expr}}} |mainlabel={{{mainlabel|}}}|format=table
 
|?{{#titleparts: {{{properties}}}|1|1}}={{#titleparts: {{{headers}}}|1|1}}
 
|?{{#titleparts: {{{properties}}}|1|1}}={{#titleparts: {{{headers}}}|1|1}}
 
}}|
 
}}|
 
{{#ask: {{{expr}}} |mainlabel={{{mainlabel|}}}|format=table}}
 
{{#ask: {{{expr}}} |mainlabel={{{mainlabel|}}}|format=table}}
 
}}}}}}}}}}}}}}</includeonly>
 
}}}}}}}}}}}}}}</includeonly>

Revision as of 16:24, 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.
Example Usage:


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

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