Difference between revisions of "Template:Infobox artwork/wikidata"
Jump to navigation
Jump to search
imported>Mike Peel (switching to requiring referenced info) |
imported>Mike Peel (update code to fetch the image - retrieve a maximum of 1 image to display.) |
||
| (5 intermediate revisions by 4 users not shown) | |||
| Line 15: | Line 15: | ||
}} | }} | ||
| − | | image = {{#invoke:InfoboxImage|InfoboxImage|image={{#invoke:WikidataIB | | + | | image = {{#invoke:InfoboxImage|InfoboxImage|image={{#invoke:WikidataIB |getValue | rank=best |P18 |name=image |qid={{{qid|}}} |suppressfields={{{suppressfields|}}} |fetchwikidata={{{fetchwikidata|ALL}}} |onlysourced=no |noicon=yes | maxvals=1|{{{image|}}}}}|size={{{image_size|}}}|sizedefault=frameless|upright={{#if:{{{image_upright|}}}|{{{image_upright}}}|1.36}}|alt={{{alt|}}}}} |
| caption = {{{caption|{{#if:{{#invoke:WikidataIB|checkBlacklist|name=caption|suppressfields={{{suppressfields|}}}}}|{{#invoke:Wikidata|getImageLegend|FETCH_WIKIDATA}}}}}}} | | caption = {{{caption|{{#if:{{#invoke:WikidataIB|checkBlacklist|name=caption|suppressfields={{{suppressfields|}}}}}|{{#invoke:Wikidata|getImageLegend|FETCH_WIKIDATA}}}}}}} | ||
| Line 52: | Line 52: | ||
| label5 = Medium | | label5 = Medium | ||
| class5 = category | | class5 = category | ||
| − | | data5 = {{If first display both|{{If two strings replace with third|{{If two strings replace with third|{{If two strings replace with third|{{#invoke:WikidataIB|getPreferredValue|P186|name=medium|qid={{{qid|}}}|suppressfields={{{suppressfields|}}}|noicon=true|fetchwikidata={{{fetchwikidata|ALL}}}|onlysourced={{{onlysourced}}}|{{if empty|{{{medium|}}}|{{{material|}}}}}}}|[[Oil paint{{!}} | + | | data5 = {{If first display both|{{If two strings replace with third|{{If two strings replace with third|{{If two strings replace with third|{{#invoke:WikidataIB|getPreferredValue|P186|name=medium|qid={{{qid|}}}|suppressfields={{{suppressfields|}}}|noicon=true|fetchwikidata={{{fetchwikidata|ALL}}}|onlysourced={{{onlysourced}}}|{{if empty|{{{medium|}}}|{{{material|}}}}}}}|[[Oil paint{{!}}Oil paint]]|[[Canvas{{!}}Canvas]]|[[Oil painting{{!}}Oil on canvas]]}}|[[Oil paint{{!}}Oil paint]]|Canvas|[[Oil painting{{!}}Oil on canvas]]}}|[[Oil paint{{!}}Oil paint]]|Panel|[[Panel painting{{!}}Oil on panel]]}}|{{#ifeq:{{{refs|no}}}|yes|{{wikidata|references|normal+|{{{qid|}}}|P186}}}} }} |
| label6 = [[Art movement|Movement]] | | label6 = [[Art movement|Movement]] | ||
| Line 152: | Line 152: | ||
| label16 = [[Geographic coordinate system|Coordinates]] | | label16 = [[Geographic coordinate system|Coordinates]] | ||
| − | | data16 = {{#if:{{#invoke:WikidataIB|checkBlacklist|name=coords|suppressfields={{{suppressfields|}}}}}|{{{coords|{{{coordinates|{{#if:{{#Property:P625}} | {{Coord | + | | data16 = {{#if:{{#invoke:WikidataIB|checkBlacklist|name=coords|suppressfields={{{suppressfields|}}}}}|{{{coords|{{{coordinates|{{#if:{{#Property:P625}} | {{Coord|display=inline,title|format=dms}}{{#ifeq:{{{refs|no}}}|yes|{{wikidata|references|normal+|{{{qid|}}}|P625}} }} }}}}}}}}}} |
| label17 = Owner | | label17 = Owner | ||
| Line 188: | Line 188: | ||
|no = <!-- no italic title --> | |no = <!-- no italic title --> | ||
||¬|all|yes = {{italic title|all={{#ifeq:{{lc:{{{italic title|}}}}}|all|true}}}} | ||¬|all|yes = {{italic title|all={{#ifeq:{{lc:{{{italic title|}}}}}|all|true}}}} | ||
| − | }}{{main other| | + | }}{{main other|{{#if:{{{backcolor|}}} |
| − | |||
| − | |||
|[[Category:Pages using infobox artwork with the backcolor parameter]] | |[[Category:Pages using infobox artwork with the backcolor parameter]] | ||
}}{{#if:{{{material|}}} | }}{{#if:{{{material|}}} | ||
Latest revision as of 15:33, 14 September 2020
| Script error: No such module "Wikidata". | |
|---|---|
| Script error: No such module "Wikidata". | |
| Year | Template:Wikidata |
| Medium | Script error: No such module "If empty". |
| Dimensions | × × × |
| Location | Template:Wikidata location |
| Coordinates | Lua error in Module:Coordinates at line 611: attempt to index field 'wikibase' (a nil value). |
| Identifiers | Template:Wikidata ID |
| Website | Template:Url |
| This template uses Lua: |
Usage
Template:Parameter names example Just add:
{{Infobox artwork/wikidata}}
to the top of an article, and data will be automatically included from Wikidata where they are available. These values can be overridden by passing values to the relevant parameters in the article (if need be), e.g.:
{{Infobox artwork/wikidata
| name =
}}
If you want to not show some properties, you can do so by giving the parameter name to the suppressfields parameter like this:
{{Infobox artwork/wikidata
| suppressfields = subject; movement
}}
Many parameters need references in Wikidata before they will be displayed here.
Parameters
| The above documentation is transcluded from Template:Infobox artwork/wikidata/doc. (edit | history) Editors can experiment in this template's sandbox (edit | diff) and testcases (create) pages. Please add categories to the /doc subpage. Subpages of this template. |