Module:WikidataIB/doc: Difference between revisions

Content deleted Content added
update doc
Usage: update documentation
Line 10:
 
Generalised calls:
<nowiki>{{#invoke:WikidataIB |getValue |<PropertyID> |name=<fieldname> |suppressfields=<list of fields which will never display> |fetchwikidata=<list of fields to fetch values from Wikidata> |onlysourced=<yes/no> |noicon=<yes/no> |df=<dmy/mdy/y> |bc=<BC/BCE> |<local parameter>}}</nowiki>
 
<nowiki>{{#invoke:WikidataIB |getSourcedValue |<PropertyID> |name=<fieldname> |suppressfields=<list of fields which will never display> |fetchwikidata=<list of fields to fetch values from Wikidata> |<local parameter>}}</nowiki>
Line 30:
 
The getValue function will accept a boolean parameter <code>noicon</code> which will suppress the "edit at Wikidata" icon for when the returned value is to be further processed by the infobox (e.g. a url). The absence of the parameter defaults to false (i.e. the icon is added). An empty value and the values "no", "false" and 0 are also treated as false; any other value is true (although "yes" is recommended for readability).
 
In order to handle the requirement for dates in mdy, dmy or just year formats, getValue accepts a named parameter {{para|df}} that may take the values "dmy", "mdy", or "y" - default is "dmy".
 
As an article may require either of suffixes BC and BCE, getValue accepts a named parameter {{para|bc}} that may take the values "BC", or "BCE" - default is "BCE". Some test cases are shown at [[Module talk:WikidataIB #Calls to getValue for dates]].
 
=== Function getSourcedValue ===
Line 87 ⟶ 91:
* df = "dmy" / "mdy" / "y" - default is "dmy"
* bc = "BC" / "BCE" - default is "BCE"
 
 
== Coding into an infobox ==