Help:Result formats (deferred mode)
Result printer (deferred mode) | |
---|---|
The @deferred query marker as identifier to delay query execution and result output generation
| |
Collection | |
Keywords | |
Table of Contents | |
Semantic MediaWiki 3.0.0Released on 11 October 2018 and compatible with MW 1.27.0 - 1.31.x. extends the #ask
and #show
parser functions used to generate inline queries with the @deferred
query marker1 as a fixed identifier to support the postponement of query execution and hereby defer (delay) the generation of query results for inline queries until after the page build process has been completed. The objective is to enable a result format to build outputs independent from the page flow and static HTML by creating a more responsive result output.
Features and limitations[edit]
The following result formats support the @deferred
query marker (ResultPrinter::isDeferrable
):
- result format "table"Outputs the results in a table (default for queries with printout statements).
- result format "broadtable"Outputs the results in a broad table.
- result format "list"Outputs results in a comma separated list, with additional outputs shown in parentheses. The output introduces class attributes to HTML elements to facilitate easy individual styling.
- result format "ol"Outputs results as a numbered list, with additional outputs shown in parentheses.
- result format "ul"Outputs results as a bulleted list, with additional outputs shown in parentheses.
- result format "category"Outputs the results in columns, with first letters as section headers, in the style of MediaWiki category pages.
- result format "template"Uses a specified template to format and display the results
- result format "embedded"Embeds selected articles.
Result formats providing data exports (ResultPrinter::isExportFormat
) do not support the @deferred
query marker since they do not create an active repository connection during the page build process:
- result format "json"Outputs results in JSON-based serialisations.
- result format "icalendar"Exports data in iCalendar format.
The same applies to inline queries with the |limit=0
option.
Dynamic output control[edit]
A result output generated using the @deferred
mode has a distinct control over its display characteristics (using the Ajax technique) and allows for its display to be independent from other article content.
To make us of the output control, @control
query marker was added1 as an identifier to help with the generation of different control elements that are separate from a result printer (or format). By default, the identifier can be assigned a slider
attribute to add a slider widget which can dynamically alter a query result by modifying the limit
option.
Examples[edit]
- Syntax
{{#ask: [[Category:Lorem ipsum]] |limit=3 |@deferred }}
- Links
See also[edit]
- Help page on Result formats
References
- a b Semantic MediaWiki: GitHub pull request gh:smw:2398 (Add support for @deferred mode)