Difference between revisions of "Template:Infobox observatory/sandbox"
Jump to navigation
Jump to search
imported>WOSlinker (child) |
imported>Uzume (Module:WikidataIB remove usage of deprecated "getPreferredValue") |
||
| (15 intermediate revisions by 8 users not shown) | |||
| Line 1: | Line 1: | ||
{{Infobox | {{Infobox | ||
| − | |bodyclass | + | | bodyclass = vcard |
| − | | | + | | titleclass = fn org |
| − | | | + | | child = {{{child|no}}} |
| − | | | + | | title = {{{name|{{#if:{{#invoke:Wikidata|ViewSomething|labels|en|value}}|{{#invoke:Wikidata|ViewSomething|labels|en|value}}|{{PAGENAMEBASE}}}}}}} |
| − | | | ||
| − | |||
| − | | | ||
| − | |||
| − | |||
| − | |||
| − | |||
| − | | | + | | image1 = {{#invoke:InfoboxImage|InfoboxImage|image={{#invoke:WikidataIB |getValue|rank=best|P18 |name=image |qid={{{qid|}}} |suppressfields={{{suppressfields|}}} |fetchwikidata={{{fetchwikidata|ALL}}} |onlysourced=no |noicon=yes|{{{image|}}}}}|size={{{image size|{{{image_size|{{{imagesize|}}}}}}}}}|sizedefault=frameless|upright={{{image_upright|1}}}|alt={{{alt|}}}|suppressplaceholder=yes}} |
| − | | | + | | caption1 = {{#if:{{{image|}}}|{{{caption|}}}|{{{caption|{{#invoke:Wikidata|getImageLegend|qid={{{qid|}}}|FETCH_WIKIDATA}}}}}}} |
| − | | | ||
| − | | | ||
| − | |||
| − | |||
| − | | | ||
| − | | | ||
| − | | | ||
| − | | | ||
| − | | | ||
| − | |||
| − | | | ||
| − | | | ||
| − | | | ||
| − | |||
| − | | | ||
| − | |||
| − | | | ||
| − | |||
| − | | | + | | image2 = {{#invoke:InfoboxImage|InfoboxImage|image={{#invoke:WikidataIB |getValue|rank=best|P154 |name=logo |qid={{{qid|}}} |suppressfields={{{suppressfields|}}} |fetchwikidata={{{fetchwikidata|ALL}}} |onlysourced=no |noicon=yes|{{{logo|}}}}}|size={{{logo size|{{{logo_size|{{{logo_width|}}}}}}}}}|sizedefault=frameless|upright={{{image_upright|1}}}|alt={{{logo_alt|}}}|suppressplaceholder=yes}} |
| − | + | | caption2 = {{{logo_caption|{{{Logo_caption|}}}}}} | |
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | <!-- | + | | label1 = Alternative names |
| − | </noinclude> | + | | data1 = {{#if:{{#invoke:WikidataIB|getValue|rank=best|P1813|name=alt_names|qid={{{qid|}}}|suppressfields={{{suppressfields|}}}|fetchwikidata={{{fetchwikidata|ALL}}}|onlysourced={{{onlysourced|no}}}|{{{alt_names|}}} }}|{{#invoke:WikidataIB|getValue|rank=best|P1813|name=alt_names|qid={{{qid|}}}|suppressfields={{{suppressfields|}}}|fetchwikidata={{{fetchwikidata|ALL}}}|onlysourced={{{onlysourced|no}}}|{{{alt_names|}}} }}|{{#ifeq:{{{fetchwikidata|ALL}}}|NONE||{{#if:{{#invoke:Wikidata|ViewSomething|aliases|en|1|value}}|{{#invoke:Wikidata|ViewSomething|aliases|en|1|value}}{{EditAtWikidata|qid={{{qid|}}} }}|}}}} }} |
| + | |||
| + | | label2 = Named after | ||
| + | | data2 = {{If first display both|{{#invoke:WikidataIB|getValue|rank=best|P138|name=namedafter|qid={{{qid|}}}|suppressfields={{{suppressfields|}}}|fetchwikidata={{{fetchwikidata|ALL}}}|onlysourced={{{onlysourced|no}}}|{{{namedafter|}}} }}|{{#ifeq:{{{refs|no}}}|yes|{{wikidata|references|normal+|{{{qid|}}}|P138}} }} }} | ||
| + | |||
| + | | label3 = Organization | ||
| + | | data3 = {{If first display both|{{#invoke:WikidataIB|getValue|rank=best|P137|name=organisation|qid={{{qid|}}}|sep="<br />"|sorted=yes|suppressfields={{{suppressfields|}}}|fetchwikidata={{{fetchwikidata|ALL}}}|onlysourced={{{onlysourced|no}}}|{{{organization|{{{organisation|}}}}}}}}|{{#ifeq:{{{refs|no}}}|yes|{{wikidata|references|normal+|{{{qid|}}}|P137}} }} }} | ||
| + | |||
| + | | label4 = [[List of observatory codes|Observatory code]] | ||
| + | | data4 = {{#invoke:WikidataIB |getValue |P717 |rank=b |name=code |spf={{{suppressfields|}}} |fwd={{{fetchwikidata|ALL}}} |osd={{{onlysourced|no}}} |lp="[List of observatory codes#" |linkpostfix={{!}} |postfix="]" |qid={{{qid|}}} |{{{code|}}} }} | ||
| + | |||
| + | | label6 = Location | ||
| + | | data6 = {{Wikidata location|suppressfields={{{suppressfields|}}}|fetchwikidata={{{fetchwikidata|ALL}}}|onlysourced={{{onlysourced|no}}}|location={{{location|}}}|refs={{{refs|no}}}|qid={{{qid|}}}}} | ||
| + | |||
| + | | label7 = [[Geographic coordinate system|Coordinates]] | ||
| + | | data7 = {{#if:{{{coordinates|{{{coords|{{{coord|}}}}}}}}} | {{#invoke:Coordinates|coordinsert|{{{coordinates|{{{coords|{{{coord}}}}}}}}}|type:landmark|{{#if:{{{location_country|}}}|region:{{CountryAbbr|{{{location_country}}}}}}}}} | {{#if:{{#Property:P625|from={{{qid|}}}}} | {{Coord|3=type:landmark{{#if:{{{location_country|}}}|_region:{{CountryAbbr|{{{location_country}}}}}}}|qid={{{qid|}}}|display={{{coordinates_display|{{{coord_display|inline,title}}}}}}|format=dms}} }} }} | ||
| + | |||
| + | | label8 = Altitude | ||
| + | | data8 = {{{altitude|{{#if:{{#property:P2044|from={{{qid|}}}}}|{{If first display both|{{#ifeq:{{#invoke:Wikidata|getUnits|P2044|qid={{{qid|}}}|FETCH_WIKIDATA}}|foot|{{convert|input=P2044|qid={{{qid|}}}|m|abbr=on}}|{{convert|input=P2044|qid={{{qid|}}}|ft|abbr=on}} }}|{{#ifeq:{{{refs|no}}}|yes|{{wikidata|references|normal+|{{{qid|}}}|P2044}} }}{{EditAtWikidata|pid=P2044|qid={{{qid|}}} }} }} }} }}} | ||
| + | |||
| + | | label9 = Weather | ||
| + | | data9 = {{{weather|}}} | ||
| + | |||
| + | | label10 = Observing time | ||
| + | | data10 = {{{obs-time|{{#if:{{#Property:P3891|from={{{qid|}}}}} | {{If first display both|{{#invoke:WikidataIB |getValue |P3891 |name=obs-time |fetchwikidata={{{fetchwikidata|ALL}}} |suppressfields={{{suppressfields|}}} |onlysourced={{{onlysourced|no}}} }} }}|{{#ifeq:{{{refs|no}}}|yes|{{wikidata|references|normal+|{{{qid|}}}|P3891}} }} }} }}} | ||
| + | |||
| + | | label11 = Established | ||
| + | | data11 = {{If first display both|{{#invoke:WikidataIB|getValue|rank=best|P1619|name=established|qid={{{qid|}}}|suppressfields={{{suppressfields|}}}|fetchwikidata={{{fetchwikidata|ALL}}}|onlysourced={{{onlysourced|no}}}|{{{established|}}}}}|{{#ifeq:{{{refs|no}}}|yes|{{wikidata|references|normal+|{{{qid|}}}|P1619}} }} }} | ||
| + | |||
| + | | label12 = Closed | ||
| + | | data12 = {{If first display both|{{#invoke:WikidataIB|getValue|rank=best|P582|name=closed|qid={{{qid|}}}|suppressfields={{{suppressfields|}}}|fetchwikidata={{{fetchwikidata|ALL}}}|onlysourced={{{onlysourced|no}}}|{{{closed|}}}}}|{{#ifeq:{{{refs|no}}}|yes|{{wikidata|references|normal+|{{{qid|}}}|P582}} }} }} | ||
| + | |||
| + | | label13 = Website | ||
| + | | data13 = {{{website|{{#if:{{#property:P856|from={{{qid|}}}}}|{{If first display both|{{Url|1={{#invoke:Wikidata|getValue|P856|qid={{{qid|}}}|FETCH_WIKIDATA}} }}|{{#ifeq:{{{refs|no}}}|yes|{{wikidata|references|normal+|{{{qid|}}}|P856}} }}{{EditAtWikidata|pid=P856|qid={{{qid|}}} }} }} }} }}} | ||
| + | |||
| + | | label15 = Architect | ||
| + | | data15 = {{{architect|}}} | ||
| + | |||
| + | | label16 = Architecture firm | ||
| + | | data16 = {{{architecture_firm|}}} | ||
| + | |||
| + | | label17 = Main contractors | ||
| + | | data17 = {{{main_contractor|{{{main_contractors|}}}}}} | ||
| + | |||
| + | | label18 = Telescopes | ||
| + | | data18 = {{#if:{{{telescope1_type|}}}||{{#invoke:WikidataIB|getValue|P527|name=telescopes|suppressfields={{{suppressfields|}}}|fetchwikidata={{{fetchwikidata|ALL}}}|onlysourced={{{onlysourced|no}}}|sep="<br />"|sorted=yes|{{{telescopes|}}} }} }} | ||
| + | |||
| + | | label19 = Commercial telescopes | ||
| + | | data19 = {{#if:{{{telescope1_type|}}}||{{#invoke:WikidataIB|getValue|P2670|name=commercialtelescopes|suppressfields={{{suppressfields|}}}|fetchwikidata={{{fetchwikidata|ALL}}}|onlysourced={{{onlysourced|no}}}|sep="<br />"|sorted=yes|{{{commercialtelescopes|}}} }} }} | ||
| + | |||
| + | | header20 = {{#if:{{{telescope1_type|}}}{{{telescope1_name|}}}|Telescopes}} | ||
| + | | data21 = {{#if:{{{telescope1_type|}}}{{{telescope1_name|}}}|{{Infobox | ||
| + | | subbox = yes | decat = yes | ||
| + | |||
| + | | label1 = {{{telescope1_name}}} | data1 = {{{telescope1_type|}}} | ||
| + | | label2 = {{{telescope2_name}}} | data2 = {{{telescope2_type|}}} | ||
| + | | label3 = {{{telescope3_name}}} | data3 = {{{telescope3_type|}}} | ||
| + | | label4 = {{{telescope4_name}}} | data4 = {{{telescope4_type|}}} | ||
| + | | label5 = {{{telescope5_name}}} | data5 = {{{telescope5_type|}}} | ||
| + | | label6 = {{{telescope6_name}}} | data6 = {{{telescope6_type|}}} | ||
| + | | label7 = {{{telescope7_name}}} | data7 = {{{telescope7_type|}}} | ||
| + | | label8 = {{{telescope8_name}}} | data8 = {{{telescope8_type|}}} | ||
| + | | label9 = {{{telescope9_name}}} | data9 = {{{telescope9_type|}}} | ||
| + | | label10 = {{{telescope10_name}}} | data10 = {{{telescope10_type|}}} | ||
| + | | label11 = {{{telescope11_name}}} | data11 = {{{telescope11_type|}}} | ||
| + | | label12 = {{{telescope12_name}}} | data12 = {{{telescope12_type|}}} | ||
| + | | label13 = {{{telescope13_name}}} | data13 = {{{telescope13_type|}}} | ||
| + | | label14 = {{{telescope14_name}}} | data14 = {{{telescope14_type|}}} | ||
| + | | label15 = {{{telescope15_name}}} | data15 = {{{telescope15_type|}}} | ||
| + | | label16 = {{{telescope16_name}}} | data16 = {{{telescope16_type|}}} | ||
| + | | label17 = {{{telescope17_name}}} | data17 = {{{telescope17_type|}}} | ||
| + | | label18 = {{{telescope18_name}}} | data18 = {{{telescope18_type|}}} | ||
| + | | label19 = {{{telescope19_name}}} | data19 = {{{telescope19_type|}}} | ||
| + | | label20 = {{{telescope20_name}}} | data20 = {{{telescope20_type|}}} | ||
| + | | label21 = {{{telescope21_name}}} | data21 = {{{telescope21_type|}}} | ||
| + | | label22 = {{{telescope22_name}}} | data22 = {{{telescope22_type|}}} | ||
| + | | label23 = {{{telescope23_name}}} | data23 = {{{telescope23_type|}}} | ||
| + | | label24 = {{{telescope24_name}}} | data24 = {{{telescope24_type|}}} | ||
| + | | label25 = {{{telescope25_name}}} | data25 = {{{telescope25_type|}}} | ||
| + | | label26 = {{{telescope26_name}}} | data26 = {{{telescope26_type|}}} | ||
| + | | label27 = {{{telescope27_name}}} | data27 = {{{telescope27_type|}}} | ||
| + | | label28 = {{{telescope28_name}}} | data28 = {{{telescope28_type|}}} | ||
| + | | label29 = {{{telescope29_name}}} | data29 = {{{telescope29_type|}}} | ||
| + | | label30 = {{{telescope30_name}}} | data30 = {{{telescope30_type|}}} | ||
| + | }}}} | ||
| + | |||
| + | | data31 = {{#if:{{{map_type|}}}|{{Location map|{{{map_type|}}} | ||
| + | | coordinates = {{if empty|{{{coordinates|{{{coords|{{{coord|}}}}}}}}}|{{Coord|qid={{{qid|}}}}}}} | ||
| + | | float = center | ||
| + | | label = {{If empty|{{{map_dot_label|}}}|{{{name|}}}|{{PAGENAMEBASE}}}} | ||
| + | | relief = {{{map_relief|}}} | ||
| + | | caption = {{If empty|{{{map_caption|}}}|Location in {{#invoke:Location map|data|{{{map_type}}}|name}}}} | ||
| + | | border = infobox | ||
| + | | width = {{{map_size|}}} | ||
| + | }}|{{#if:{{{image_map|}}}|{{#invoke:InfoboxImage|InfoboxImage|image={{{image_map|}}}|size={{{map_size|}}}|sizedefault=frameless|alt={{{map_alt|}}}}}|{{Wikidata location map|qid={{{qid|}}}|locmapin={{{locmapin|}}}|map_caption={{{map_caption|}}}|name={{{name|}}}}}}}}} | ||
| + | | caption3 = {{#if:{{{image_map|}}}|{{{map_caption|}}}}} | ||
| + | |||
| + | | data32 = {{{commons_category | {{#if:{{#invoke:WikidataIB |getCommonsLink|qid={{{qid|}}}|onlycat=True|fallback=False}}| {{cclink|{{#invoke:String|replace|{{#invoke:WikidataIB |getCommonsLink|qid={{{qid|}}}|onlycat=True|fallback=False}}|Category:|}}|Related media on Wikimedia Commons}} }}}}} | ||
| + | |||
| + | | header35 = {{{embedded|}}} | ||
| + | |||
| + | | below = {{#ifeq:{{{fetchwikidata|ALL}}}|NONE||{{EditOnWikidata|qid={{{qid|}}}}}}} | ||
| + | |||
| + | }}<includeonly>{{main other|{{#if:{{safesubst:#invoke:Check for unknown parameters|check|unknown=1|preview=1|locmapin|refs}}|[[Category:Articles using Infobox observatory using locally defined parameters]]|[[Category:Articles with infoboxes completely from Wikidata]]}}}}</includeonly><noinclude> | ||
| + | {{Documentation}}</noinclude> | ||
Latest revision as of 16:22, 13 September 2020
| Alternative names | Script error: No such module "Wikidata".Script error: No such module "EditAtWikidata". |
|---|---|
| Location | Template:Wikidata location |
| Coordinates | Lua error in Module:Coordinates at line 611: attempt to index field 'wikibase' (a nil value). |
| Website | Template:UrlScript error: No such module "EditAtWikidata". |
| Template:Wikidata location map | |
| This is the template sandbox page for Template:Infobox observatory (diff). See also the companion subpage for test cases. |
| This template uses Lua: |
Contents
Usage
Simple
{{Infobox observatory}}
Data will be automatically included from Wikidata.
Full
| [[File:{{{image}}}|frameless|alt={{{alt}}}|upright=1|{{{alt}}}]] {{{caption}}} | |||||||||
| [[File:{{{logo}}}|frameless|alt={{{logo_alt}}}|upright=1|{{{logo_alt}}}]] {{{logo_caption}}} | |||||||||
| Alternative names | {{{alt_names}}} | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Named after | {{{namedafter}}} | ||||||||
| Organization | {{{organization}}} | ||||||||
| Observatory code | {{{code}}} | ||||||||
| Location | Lua error in Module:WikidataIB at line 1528: attempt to index field 'wikibase' (a nil value). | ||||||||
| Coordinates | {{{coordinates}}} | ||||||||
| Altitude | {{{altitude}}} | ||||||||
| Weather | {{{weather}}} | ||||||||
| Observing time | {{{obs-time}}} | ||||||||
| Established | {{{established}}} | ||||||||
| Closed | {{{closed}}} | ||||||||
| Website | {{{website}}} | ||||||||
| Architect | {{{architect}}} | ||||||||
| Architecture firm | {{{architecture_firm}}} | ||||||||
| Main contractors | {{{main_contractor}}} | ||||||||
| Telescopes | |||||||||
| |||||||||
| Template:Wikidata location map | |||||||||
| {{{commons_category}}} | |||||||||
{{Infobox observatory
| name =
| image =
| caption =
| alt =
| logo =
| logo_caption =
| logo_alt =
| alt_names =
| namedafter =
| organization =
| code =
| location =
| coordinates = <!-- {{Coord|LAT|LONG|type:landmark|display=inline,title}} -->
| altitude =
| weather =
| obs-time =
| established = <!-- {{Start date|YYYY|MM|DD}} -->
| closed =
| website = <!-- {{URL|example.com}} -->
| architect =
| architecture_firm =
| main_contractor =
| telescope1_name =
| telescope1_type =
| telescope2_name =
| telescope2_type =
| telescope3_name =
| telescope3_type =
| telescope4_name =
| telescope4_type =
| commons_category =
}}
Parameters
This template returns values from Wikidata where they are available; these values can be overridden by passing values to the relevant parameters.
| Parameter | Default | Description |
|---|---|---|
| name | Wikidata label (en) (Or Page name) |
name of the observatory |
| image | Lua error in Module:Wd at line 196: attempt to index field 'wikibase' (a nil value). (P18) | image (use full wikicode) |
| caption | Lua error in Module:Wd at line 196: attempt to index field 'wikibase' (a nil value). (P2096) | image caption |
| alt | alt caption | |
| logo | logo | |
| logo_caption | logo caption | |
| logo_alt | logo alt caption | |
| alt_names | Wikidata aliases (en) | alternative names / aliases for the telescope |
| namedafter | Lua error in Module:Wd at line 196: attempt to index field 'wikibase' (a nil value). (P138) | person or organisation the observatory was named after |
| organization | Lua error in Module:Wd at line 196: attempt to index field 'wikibase' (a nil value). (P137) | organization responsible for the observatory |
| code | Lua error in Module:Wd at line 196: attempt to index field 'wikibase' (a nil value). (P717) | observatory code |
| location | Lua error in Module:Wd at line 196: attempt to index field 'wikibase' (a nil value). (P706), Lua error in Module:Wd at line 196: attempt to index field 'wikibase' (a nil value). (P276), Lua error in Module:Wd at line 196: attempt to index field 'wikibase' (a nil value). (P131), Lua error in Module:Wd at line 196: attempt to index field 'wikibase' (a nil value). (P17) (fallback to Lua error in Module:Wd at line 196: attempt to index field 'wikibase' (a nil value). (P30) for Antarctica) | observatory's location |
| coordinates | Lua error in Module:Wd at line 196: attempt to index field 'wikibase' (a nil value). (P625) | location coordinates, use {{coord}} with display=inline,title |
| altitude | Lua error in Module:Wd at line 196: attempt to index field 'wikibase' (a nil value). (P2044) | altitude of the observatory |
| weather | weather | |
| obs-time | Lua error in Module:Wd at line 196: attempt to index field 'wikibase' (a nil value). (P3891) | observing time available |
| established | Lua error in Module:Wd at line 196: attempt to index field 'wikibase' (a nil value). (P1619) | when the observatory was established, use {{start date}} |
| closed | Lua error in Module:Wd at line 196: attempt to index field 'wikibase' (a nil value). (P582) | when the observatory was closed, if appropriate |
| telescopes | Lua error in Module:Wd at line 196: attempt to index field 'wikibase' (a nil value). (P527) | names of the telescopes at the observatory |
| website | Lua error in Module:Wd at line 196: attempt to index field 'wikibase' (a nil value). (P856) | URL of the website for the observatory, use {{URL}} |
| architect | architect | |
| architecture_firm | architecture firm | |
| main_contractor | main contractor | |
| telescope1_name | name of the observatory's first telescope | |
| telescope1_type | first telescope's type (and any additional information) | |
| telescope2_name | name of the observatory's second telescope | |
| telescope2_type | second telescope's type (and any additional information) | |
| etc... | ||
| telescope29_name | name of the observatory's twenty-ninth telescope | |
| telescope29_type | twenty-ninth telescope's type (and any additional information) | |
| telescope30_name | name of the thirtieth telescope | |
| telescope30_type | thirtieth telescope's type (and any additional information) | |
| locmapin | Lua error in Module:Wd at line 196: attempt to index field 'wikibase' (a nil value). (P17) | use this parameter to override the location map shown, if necessary. See {{Wikidata location map}} |
| commons_category | commons sitelink | category name at Wikimedia Commons |
| refs | no | set to 'yes' to automatically display references from Wikidata |
| child | no | set to 'yes' to use as a child infobox of another infobox |
| embedded | embed another infobox into this one | |
Examples of use
- Infoboxes which only use Wikidata (no local parameters)
Microformat
Tracking categories
- Category:Articles using Infobox observatory using locally defined parameters (0)
- Category:Articles with infoboxes completely from Wikidata (0)
See also
Template:Organization infoboxes
| The above documentation is transcluded from Template:Infobox observatory/doc. (edit | history) Editors can experiment in this template's sandbox (edit | diff) and testcases (edit) pages. Please add categories to the /doc subpage. Subpages of this template. |