Module:WikidataIB/sandbox1/doc: Difference between revisions

Content deleted Content added
Parameters to getValue: qualifier link/pre/postfix
Utility functions: document functions formatNumber and examine
Line 444:
* failing that, the Wikidata entity ID asociated with the curent page, if it exists;
* otherwise, nothing
 
=== Function formatNumber ===
formatNumber reads a number supplied in the first unnamed parameter (or {{para|num}} as a named alias) and a language code in the {{para|lang}} parameter. If no valid language parameter is supplied, it uses the user's set language where available, otherwise the wiki's content language. It returns the number formatted according to the language conventions of that language.
* Example: <code><nowiki>{{#invoke:WikidataIB |formatNumber |1.23456789e6 |lang=de}}</nowiki></code> → {{#invoke:WikidataIB |formatNumber |1.23456789e6 |lang=de}}
 
=== Function examine ===
examine provides a dump of the entire property given in the first unnamed parameter (or in {{para|pid}} as a named alias) from the item given by the parameter 'qid', or from the item corresponding to the current page if qid is not supplied. It works in a similar manner to the [[Module:Wikidata|Dump]] function, but only loads a single claim, rather than the whole Wikidata entry.
* Example: <code><nowiki>{{#invoke:WikidataIB |examine |qid=Q1396889 |P50}}</nowiki></code>
 
== Coding into an infobox ==