« Take Snapshot » : différence entre les versions

De Semantic MediaWiki - Sandbox

(better notes.)
(keep the links)
 
Ligne 24 : Ligne 24 :
  |format=template
  |format=template
  |template=safesubst:Snapshot
  |template=safesubst:Snapshot
|link=none
  }}</nowiki>
  }}</nowiki>


Ligne 30 : Ligne 29 :
==Template Output==
==Template Output==
[[SMW::off]]
[[SMW::off]]
*:smw-border:
*[[::smw-border:|:smw-border:]]
*ScientificArticle 122919 juillet 2017 15:46:13Utilisateur:HermannSchwaerzler
*[[:ScientificArticle 1229|"Just a Test, nothing less, nothing more" by Noe, Jane;&#32;Doe, John]]19 juillet 2017 15:46:13[[:Utilisateur:HermannSchwaerzler|HermannSchwaerzler]]
*ScientificArticle 1229#_QUERY8117187b564363d565b7ae6d29a1a1f0
*<span class="smw-subobject-entity">[[:ScientificArticle 1229#_QUERY8117187b564363d565b7ae6d29a1a1f0|"Just a Test, nothing less, nothing more" by Noe, Jane;&#32;Doe, John]]</span>
*ScientificArticle 1229#_QUERYb313d6eb2929b9c643a123abac6a9e7e
*<span class="smw-subobject-entity">[[:ScientificArticle 1229#_QUERYb313d6eb2929b9c643a123abac6a9e7e|"Just a Test, nothing less, nothing more" by Noe, Jane;&#32;Doe, John]]</span>
*ScientificArticle 5763920 juillet 2017 06:59:18Utilisateur:HermannSchwaerzler<span class="smw-template-furtherresults">[[:Special:Ask/-5B-5B:+-5D-5D/-3FCreation-20date/-3FLast-20editor-20is/mainlabel=/limit=5/offset=5/format=template/link=none/template=safesubst:Snapshot|... further results]]</span>[[SMW::on]]
*[[:ScientificArticle 57639|"Next Test - no mapping property" by Doe, John;&#32;Noe, Jane]]20 juillet 2017 06:59:18[[:Utilisateur:HermannSchwaerzler|HermannSchwaerzler]]<span class="smw-template-furtherresults">[[:Special:Ask/-5B-5B:+-5D-5D/-3FCreation-20date/-3FLast-20editor-20is/mainlabel=/limit=5/offset=5/format=template/template=safesubst:Snapshot|... further results]]</span>[[SMW::on]]

Dernière version du 8 août 2019 à 20:51

To take a 'snapshot' of the results of an ask query, you can use parser function substitution.

For example, the following statement:

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

If entered on an page, would substitute the results/output (writing the information to the page) instead of leaving an in-line query behind.

Output

... further results


Formatting

Notice the output is very raw (not the clean wiki-markup you might have been expecting). 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.