Difference between revisions of "Template:Infobox artwork/wikidata"
Jump to navigation
Jump to search
imported>Mike Peel (add no-breaking space) |
imported>Mike Peel (update code to fetch the image - retrieve a maximum of 1 image to display.) |
||
| (6 intermediate revisions by 4 users not shown) | |||
| Line 11: | Line 11: | ||
| subheader = {{comma separated entries | | subheader = {{comma separated entries | ||
| − | | 1 = {{#if:{{{other_title_1|{{#invoke:Wikidata|ViewSomething|aliases|en|1|value}}}}}|{{#if:{{#invoke:WikidataIB|checkBlacklist|name=other_title_1|onlysourced={{{onlysourced | + | | 1 = {{#if:{{{other_title_1|{{#invoke:Wikidata|ViewSomething|aliases|en|1|value}}}}}|{{#if:{{#invoke:WikidataIB|checkBlacklist|name=other_title_1|onlysourced={{{onlysourced}}}|suppressfields={{{suppressfields|}}}}}|{{#if:{{{other_language_1|}}}|{{{other_language_1|}}}: }} ''{{{other_title_1|{{#invoke:Wikidata|ViewSomething|aliases|en|1|value}}}}}'' }}}} |
| 2 = {{#if:{{{other_title_2|}}}|{{#if:{{{other_language_2|}}}| {{{other_language_2|}}}: }} ''{{{other_title_2|}}}'' }} | | 2 = {{#if:{{{other_title_2|}}}|{{#if:{{{other_language_2|}}}| {{{other_language_2|}}}: }} ''{{{other_title_2|}}}'' }} | ||
}} | }} | ||
| − | | 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 36: | Line 36: | ||
| class1 = attendee | | class1 = attendee | ||
| data1 = {{#if:{{{artist|{{#Property:P170|from={{{qid|}}}}}}}} | | data1 = {{#if:{{{artist|{{#Property:P170|from={{{qid|}}}}}}}} | ||
| − | |{{#ifeq:{{ucfirst:{{{artist|{{#Property:P170|from={{{qid|}}}}}}}}}}|Unknown|Unknown|{{#ifeq:{{ucfirst:{{{artist|{{#Property:P170|from={{{qid|}}}}}}}}}}|Anonymous|Anonymous|{{#invoke:WikidataIB|getPreferredValue|P170|name=artist|qid={{{qid|}}}|suppressfields={{{suppressfields|}}}|fetchwikidata={{{fetchwikidata|ALL}}}|onlysourced={{{onlysourced | + | |{{#ifeq:{{ucfirst:{{{artist|{{#Property:P170|from={{{qid|}}}}}}}}}}|Unknown|Unknown|{{#ifeq:{{ucfirst:{{{artist|{{#Property:P170|from={{{qid|}}}}}}}}}}|Anonymous|Anonymous|{{#invoke:WikidataIB|getPreferredValue|P170|name=artist|qid={{{qid|}}}|suppressfields={{{suppressfields|}}}|fetchwikidata={{{fetchwikidata|ALL}}}|onlysourced={{{onlysourced}}}|{{{artist|}}}}}}}{{#ifeq:{{{refs|no}}}|yes|{{wikidata|references|normal+|{{{qid|}}}|P170}} }} }} |
|{{{designer|}}} | |{{{designer|}}} | ||
}} | }} | ||
| label2 = {{#if:{{{year|{{#Property:P571|from={{{qid|}}}}}}}}|Year|Completion date}} | | label2 = {{#if:{{{year|{{#Property:P571|from={{{qid|}}}}}}}}|Year|Completion date}} | ||
| − | | data2 = {{#if:{{#invoke:WikidataIB|checkBlacklist|name=year|onlysourced={{{onlysourced | + | | data2 = {{#if:{{#invoke:WikidataIB|checkBlacklist|name=year|onlysourced={{{onlysourced}}}|suppressfields={{{suppressfields|}}}}}|{{#if:{{{year|{{#Property:P571|from={{{qid|}}}}}}}}|{{{year|{{#ifeq:{{#invoke:wd|qualifier|P571|P1480}}|circa|{{circa}} |}}{{wikidata|property|{{{qid|}}}|P571}}}}}|{{{completion_date|}}}}}}} |
| label3 = {{#if:{{{catalog|}}}|Catalog|Catalogue}} | | label3 = {{#if:{{{catalog|}}}|Catalog|Catalogue}} | ||
| 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 | + | | 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]] | ||
| class6 = category | | class6 = category | ||
| − | | data6 = {{If first display both|{{#invoke:WikidataIB|getPreferredValue|P135|name=movement|qid={{{qid|}}}|suppressfields={{{suppressfields|}}}|fetchwikidata={{{fetchwikidata|ALL}}}|onlysourced={{{onlysourced | + | | data6 = {{If first display both|{{#invoke:WikidataIB|getPreferredValue|P135|name=movement|qid={{{qid|}}}|suppressfields={{{suppressfields|}}}|fetchwikidata={{{fetchwikidata|ALL}}}|onlysourced={{{onlysourced}}}|{{{movement|}}}}}|{{#ifeq:{{{refs|no}}}|yes|{{wikidata|references|normal+|{{{qid|}}}|P135}}}} }} |
| label7 = Subject | | label7 = Subject | ||
| − | | data7 = {{If first display both|{{#invoke:WikidataIB|getPreferredValue|P921|name=subject|qid={{{qid|}}}|suppressfields={{{suppressfields|}}}|fetchwikidata={{{fetchwikidata|ALL}}}|onlysourced={{{onlysourced | + | | data7 = {{If first display both|{{#invoke:WikidataIB|getPreferredValue|P921|name=subject|qid={{{qid|}}}|suppressfields={{{suppressfields|}}}|fetchwikidata={{{fetchwikidata|ALL}}}|onlysourced={{{onlysourced}}}|{{{subject|}}}}}|{{#ifeq:{{{refs|no}}}|yes|{{wikidata|references|normal+|{{{qid|}}}|P921}}}} }} |
| label8 = Dimensions<!--BEGIN DIMENSIONAL DATA SECTION; INCLUDES SCARY CODE ;)--> | | label8 = Dimensions<!--BEGIN DIMENSIONAL DATA SECTION; INCLUDES SCARY CODE ;)--> | ||
| Line 140: | Line 140: | ||
| label11 = Weight | | label11 = Weight | ||
| − | | data11 = {{#if:{{#invoke:WikidataIB|checkBlacklist|name=caption|onlysourced={{{onlysourced | + | | data11 = {{#if:{{#invoke:WikidataIB|checkBlacklist|name=caption|onlysourced={{{onlysourced}}}|suppressfields={{{weight|}}}}}|{{{weight|{{#if:{{#Property:P2067|from={{{qid|}}}}}|{{#ifeq:{{#invoke:Wikidata|getUnits|P2067|qid={{{qid|}}}|FETCH_WIKIDATA}}|kg|{{convert|input=P2067|lb|abbr=on|qid={{{qid|}}}}}|{{convert|input=P2067|kg|abbr=on|qid={{{qid|}}}}} }}{{#ifeq:{{{refs|no}}}|yes|{{wikidata|references|normal+|{{{qid|}}}|P2067}}}}}}}}}}} |
| label12 = Designation | | label12 = Designation | ||
| − | | data12 = {{If first display both|{{#invoke:WikidataIB|getPreferredValue|P1435|name=designation|qid={{{qid|}}}|suppressfields={{{suppressfields|}}}|fetchwikidata={{{fetchwikidata|ALL}}}|onlysourced={{{onlysourced | + | | data12 = {{If first display both|{{#invoke:WikidataIB|getPreferredValue|P1435|name=designation|qid={{{qid|}}}|suppressfields={{{suppressfields|}}}|fetchwikidata={{{fetchwikidata|ALL}}}|onlysourced={{{onlysourced}}}|{{{designation|}}}}}|{{#ifeq:{{{refs|no}}}|yes|{{wikidata|references|normal+|{{{qid|}}}|P1435}} }} }} |
| label13 = Condition | | label13 = Condition | ||
| Line 149: | Line 149: | ||
| label14 = Location | | label14 = Location | ||
| − | | data14 = {{#if:{{{museum|}}}|{{{museum}}}{{#if:{{{city|}}}|{{{city}}}}}|{{Wikidata location|qid={{{qid|}}}|refs={{{refs|no}}}|suppressfields={{{suppressfields|}}}|fetchwikidata={{{fetchwikidata|ALL}}}|onlysourced={{{onlysourced | + | | data14 = {{#if:{{{museum|}}}|{{{museum}}}{{#if:{{{city|}}}|{{{city}}}}}|{{Wikidata location|qid={{{qid|}}}|refs={{{refs|no}}}|suppressfields={{{suppressfields|}}}|fetchwikidata={{{fetchwikidata|ALL}}}|onlysourced={{{onlysourced}}}|location={{{location|}}} }} }} |
| 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 | ||
<!-- Only display this if it is different from the collection --> | <!-- Only display this if it is different from the collection --> | ||
| − | | data17 = {{#ifeq:{{#Property:P127|from={{{qid|}}}}}|{{#Property:P195|from={{{qid|}}}}}||{{If first display both|{{#invoke:WikidataIB|getPreferredValue|P127|name=owner|qid={{{qid|}}}|suppressfields={{{suppressfields|}}}|fetchwikidata={{{fetchwikidata|ALL}}}|onlysourced={{{onlysourced | + | | data17 = {{#ifeq:{{#Property:P127|from={{{qid|}}}}}|{{#Property:P195|from={{{qid|}}}}}||{{If first display both|{{#invoke:WikidataIB|getPreferredValue|P127|name=owner|qid={{{qid|}}}|suppressfields={{{suppressfields|}}}|fetchwikidata={{{fetchwikidata|ALL}}}|onlysourced={{{onlysourced}}}|{{{owner|}}}}}|{{#ifeq:{{{refs|no}}}|yes|{{wikidata|references|normal+|{{{qid|}}}|P127}} }} }} }} |
| label18 = Commissioned by | | label18 = Commissioned by | ||
| − | | data18 = {{If first display both|{{#invoke:WikidataIB|getPreferredValue|P88|name=commissionedby|qid={{{qid|}}}|suppressfields={{{suppressfields|}}}|fetchwikidata={{{fetchwikidata|ALL}}}|onlysourced={{{onlysourced | + | | data18 = {{If first display both|{{#invoke:WikidataIB|getPreferredValue|P88|name=commissionedby|qid={{{qid|}}}|suppressfields={{{suppressfields|}}}|fetchwikidata={{{fetchwikidata|ALL}}}|onlysourced={{{onlysourced}}}|{{{commissionedby|}}}}}|{{#ifeq:{{{refs|no}}}|yes|{{wikidata|references|normal+|{{{qid|}}}|P88}} }} }} |
| label19 = Collection | | label19 = Collection | ||
<!-- Only display this if it is different from the location --> | <!-- Only display this if it is different from the location --> | ||
| − | | data19 = {{#ifeq:{{#Property:P276|from={{{qid|}}}}}|{{#Property:P195|from={{{qid|}}}}}||{{If first display both|{{#invoke:WikidataIB|getPreferredValue|P195|name=collection|qid={{{qid|}}}|suppressfields={{{suppressfields|}}}|fetchwikidata={{{fetchwikidata|ALL}}}|onlysourced={{{onlysourced | + | | data19 = {{#ifeq:{{#Property:P276|from={{{qid|}}}}}|{{#Property:P195|from={{{qid|}}}}}||{{If first display both|{{#invoke:WikidataIB|getPreferredValue|P195|name=collection|qid={{{qid|}}}|suppressfields={{{suppressfields|}}}|fetchwikidata={{{fetchwikidata|ALL}}}|onlysourced={{{onlysourced}}}|{{{collection|}}}}}|{{#ifeq:{{{refs|no}}}|yes|{{wikidata|references|normal+|{{{qid|}}}|P195}} }} }} }} |
| label20 = Accession No. | | label20 = Accession No. | ||
| − | | data20 = {{If first display both|{{#invoke:WikidataIB|getPreferredValue|P217|name=accession|qid={{{qid|}}}|suppressfields={{{suppressfields|}}}|fetchwikidata={{{fetchwikidata|ALL}}}|onlysourced={{{onlysourced | + | | data20 = {{If first display both|{{#invoke:WikidataIB|getPreferredValue|P217|name=accession|qid={{{qid|}}}|suppressfields={{{suppressfields|}}}|fetchwikidata={{{fetchwikidata|ALL}}}|onlysourced={{{onlysourced}}}|{{{accession|}}}}}|{{#ifeq:{{{refs|no}}}|yes|{{wikidata|references|normal+|{{{qid|}}}|P217}} }} }} |
| label21 = Preceded by | | label21 = Preceded by | ||
| − | | data21 = {{If first display both|{{#invoke:WikidataIB|getPreferredValue|P155|name=preceded_by|qid={{{qid|}}}|suppressfields={{{suppressfields|}}}|fetchwikidata={{{fetchwikidata|ALL}}}|onlysourced={{{onlysourced | + | | data21 = {{If first display both|{{#invoke:WikidataIB|getPreferredValue|P155|name=preceded_by|qid={{{qid|}}}|suppressfields={{{suppressfields|}}}|fetchwikidata={{{fetchwikidata|ALL}}}|onlysourced={{{onlysourced}}}|{{{preceded_by|}}}}}|{{#ifeq:{{{refs|no}}}|yes|{{wikidata|references|normal+|{{{qid|}}}|P155}} }} }} |
| label22 = Followed by | | label22 = Followed by | ||
| − | | data22 = {{If first display both|{{#invoke:WikidataIB|getPreferredValue|P156|name=followed_by|qid={{{qid|}}}|suppressfields={{{suppressfields|}}}|fetchwikidata={{{fetchwikidata|ALL}}}|onlysourced={{{onlysourced | + | | data22 = {{If first display both|{{#invoke:WikidataIB|getPreferredValue|P156|name=followed_by|qid={{{qid|}}}|suppressfields={{{suppressfields|}}}|fetchwikidata={{{fetchwikidata|ALL}}}|onlysourced={{{onlysourced}}}|{{{followed_by|}}}}}|{{#ifeq:{{{refs|no}}}|yes|{{wikidata|references|normal+|{{{qid|}}}|P156}} }} }} |
| label23 = Identifiers | | label23 = Identifiers | ||
| 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. |