« Take Snapshot » : différence entre les versions

De Semantic MediaWiki - Sandbox

Ligne 26 : Ligne 26 :
  }}</nowiki>
  }}</nowiki>


==Template Output==
[[SMW::off]]
[[SMW::off]]
*[[::smw-border:|:smw-border:]]
*[[::smw-border:|:smw-border:]]

Version du 8 août 2019 à 20:46

To take a 'snapshot' of the results of an ask query, use safesubst when calling the function.

For example:

{{safesubst:#ask: [[:+]]
 |?Creation date
 |?Last editor is
 |limit=5
 |format=ul
 }}

If entered on an page, on saving this would substitute the results/output (writing the information to the page) instead of leaving a dynamic reference.

Output

... further results


Formatting

However, the raw output format can make for a messy result (not the clean wiki-markup you might expect). To get around this, you can use the template format which will give you additional control over what is being substituted (not to mention, control over how 'deep' of a substitution you want to do).

{{safesubst:#ask: [[:+]]
 |?Creation date
 |?Last editor is
 |limit=5
 |format=template
 |template=safesubst:Snapshot
 }}


Template Output

Les cookies nous aident à fournir nos services. En utilisant nos services, vous acceptez notre utilisation de cookies.