Module:WikidataIB/doc: Difference between revisions

Content deleted Content added
Usage: add local parameter to general call
Usage: locally supplied value if it is supplied is the second unnamed parameter
Line 10:
* The module provides one call at present: <code>getValue</code>
* getValue can take a named parameter {{para|qid}} which is the Wikidata ID for the article. This will not normally be used but is available for testing, although it makes the call ''expensive''.
* The name of the field that this function is called from is passed in the named parameter {{para|name}}, which is first checked against a blacklist of fields that are never to be displayed, (i.e. the call must return nil in all circumstances). If the fiels is not on the blacklist, it is then checked against a whitelist. If the name of the field matches, the call will return any locally supplied value if it is supplied as the second unnamed parameter, or the Wikidata value otherwise.
* The name is compulsory when the blacklist or whitelist is used, so the module returns nil if it is not supplied.
* The blacklist is passed in the named parameter {{para|suppressfields}}