Content deleted Content added
Sticks to Burton |
consistency |
||
(6 intermediate revisions by 4 users not shown) | |||
Line 1:
{{Ombox|image=[[
{{module rating|protected}}
{{High-use}}
Line 37:
will do the same as getValue, but takes an extra parameter, which is the QID of the Wikidata item that you want to get the property value from.
For example:
* <code><nowiki>{{#invoke:Wikidata|getValueFromID|{{
will fetch a list of the linked values for 'spouse' (P26) from redirect page title [[Richard Burton (actor) ]] (corresponding to Wikidata label {{Q|{{Get QID|Richard Burton (actor) }}}}) from anywhere in the English Wikipedia.
Line 58:
* <code><nowiki>| data55 = {{#invoke:Wikidata|getValue|P26|{{{spouse|FETCH_WIKIDATA}}} }}</nowiki></code>
which causes the infobox to:
# not display spouse if the infobox parameter <code>|spouse</code> is set to be blank (as <code>"| spouse ="</code>
# display the linked value(s) from Wikidata if the infobox parameter <code>|spouse</code> is not supplied
# display the local infobox parameter <code>|spouse</code> if it is supplied (e.g. <code>"|spouse = Hillary Rodham Clinton"</code>)
Line 110:
=== Testing spouse ===
Copy and paste the following into any article and preview it (please don't save!):
<syntaxhighlight lang="
* - {{#invoke:Wikidata|getValue|P26|}}
* - {{#invoke:Wikidata|getValue|P26|FETCH_WIKIDATA}}
Line 141:
=== Testing birthplace ===
Copy and paste the following into any article and preview it (please don't save!):
<syntaxhighlight lang="
* - {{#invoke:Wikidata|getValue|P19|}}
* - {{#invoke:Wikidata|getValue|P19|FETCH_WIKIDATA}}
Line 150:
=== Testing getValue, getRawValue and getDateValue ===
Copy and paste the following into any article and preview it (please don't save!):
<syntaxhighlight lang="wikitext">
* - {{#invoke:Wikidata|getValue|P19|FETCH_WIKIDATA}}
* - {{#invoke:Wikidata|getValue|P26|FETCH_WIKIDATA}}
Line 159:
* - {{#invoke:Wikidata|getDateValue|P569|FETCH_WIKIDATA|mdy}}
* - {{#invoke:Wikidata|getDateValue|P569|FETCH_WIKIDATA|y}}
</syntaxhighlight>
This should return the Wikidata values for birthplace, spouse, citizenship, religion, gender, date of birth (twice) and year of birth, if they exist. The dob is first in dmy format and then in mdy.
=== Testing dates BC/BCE ===
Copy and paste the following into a short section of article such as [[Horace #See also]] and preview it (please don't save!):
<syntaxhighlight lang="wikitext">
* - {{#invoke:Wikidata|getDateValue|P569|FETCH_WIKIDATA|y}}
* - {{#invoke:Wikidata|getDateValue|P569|FETCH_WIKIDATA|y|BCE}}
</syntaxhighlight>
This should return 65 BC and 65 BCE, respectively.
|