Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>There is no way to directly do this in stock MediaWiki, although you can fake it up somewhat with templates. For example, you could can a template something like this:</p> <pre><code>{{#switch:{{{key}}} | key1 = value1 | key2 = value2 | key3 = value3 ... }} </code></pre> <p><a href="http://en.wikipedia.org/wiki/Template%3aNUMBEROF/data" rel="nofollow">Template:NUMBEROF/data</a> on the English Wikipedia is an example of this style (with two levels of keys).</p> <p>Or you can create a set of templates, one for each "record", that each take an "output formatter" template as a parameter and pass that output formatter a named parameter for each column in the record. The <a href="http://en.wikipedia.org/wiki/Category%3aCountry_data_templates" rel="nofollow">Country data templates</a> on the English Wikipedia are an example of this pattern.</p> <p>Or you could combine the above two styles, with one parameter to select the row (as in the first style) and a second to provide the output formatter (as in the second).</p> <p>If you don't mind installing extensions, you could use the <a href="http://www.mediawiki.org/wiki/Extension%3aLabeled_Section_Transclusion" rel="nofollow">Labeled Section Transclusion</a> extension to transclude sections of a data page. Or you could install the <a href="http://semantic-mediawiki.org/wiki/Semantic_MediaWiki" rel="nofollow">Semantic MediaWiki</a> extension, which I hear allows all sorts of querying of data from the wiki's pages. Or you could install one of the many <a href="http://www.mediawiki.org/wiki/Category%3aDatabase_extensions" rel="nofollow">Database extensions</a> that may allow you to do what you want. Or you could write your own database extension.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload