Difference between revisions of "Template:Infobox observatory/sandbox"
Jump to navigation
Jump to search
imported>RexxS (update - external ids now return external links) |
imported>Uzume (Module:WikidataIB remove usage of deprecated "getPreferredValue") |
||
| Line 5: | Line 5: | ||
| title = {{{name|{{#if:{{#invoke:Wikidata|ViewSomething|labels|en|value}}|{{#invoke:Wikidata|ViewSomething|labels|en|value}}|{{PAGENAMEBASE}}}}}}} | | title = {{{name|{{#if:{{#invoke:Wikidata|ViewSomething|labels|en|value}}|{{#invoke:Wikidata|ViewSomething|labels|en|value}}|{{PAGENAMEBASE}}}}}}} | ||
| − | | image1 = {{#invoke:InfoboxImage|InfoboxImage|image={{#invoke:WikidataIB | | + | | 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}}}}}}} | | caption1 = {{#if:{{{image|}}}|{{{caption|}}}|{{{caption|{{#invoke:Wikidata|getImageLegend|qid={{{qid|}}}|FETCH_WIKIDATA}}}}}}} | ||
| − | | image2 = {{#invoke:InfoboxImage|InfoboxImage|image={{#invoke:WikidataIB | | + | | 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|}}}}}} | | caption2 = {{{logo_caption|{{{Logo_caption|}}}}}} | ||
| label1 = Alternative names | | label1 = Alternative names | ||
| − | | data1 = {{#if:{{#invoke:WikidataIB| | + | | 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 | | label2 = Named after | ||
| − | | data2 = {{If first display both|{{#invoke:WikidataIB| | + | | 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 | | label3 = Organization | ||
| − | | data3 = {{If first display both|{{#invoke:WikidataIB| | + | | 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]] | | label4 = [[List of observatory codes|Observatory code]] | ||
| Line 27: | Line 27: | ||
| label7 = [[Geographic coordinate system|Coordinates]] | | 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|}}} | + | | 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 | | label8 = Altitude | ||
| Line 39: | Line 39: | ||
| label11 = Established | | label11 = Established | ||
| − | | data11 = {{If first display both|{{#invoke:WikidataIB| | + | | 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 | | label12 = Closed | ||
| − | | data12 = {{If first display both|{{#invoke:WikidataIB| | + | | 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 | | label13 = Website | ||
| Line 99: | Line 99: | ||
| data31 = {{#if:{{{map_type|}}}|{{Location map|{{{map_type|}}} | | data31 = {{#if:{{{map_type|}}}|{{Location map|{{{map_type|}}} | ||
| − | | coordinates = {{if empty|{{{coordinates|{{{coords|{{{coord|}}}}}}}}}|{{Coord|qid={{{qid|}}} | + | | coordinates = {{if empty|{{{coordinates|{{{coords|{{{coord|}}}}}}}}}|{{Coord|qid={{{qid|}}}}}}} |
| float = center | | float = center | ||
| label = {{If empty|{{{map_dot_label|}}}|{{{name|}}}|{{PAGENAMEBASE}}}} | | label = {{If empty|{{{map_dot_label|}}}|{{{name|}}}|{{PAGENAMEBASE}}}} | ||
| Line 109: | Line 109: | ||
| caption3 = {{#if:{{{image_map|}}}|{{{map_caption|}}}}} | | caption3 = {{#if:{{{image_map|}}}|{{{map_caption|}}}}} | ||
| − | | data32 = {{{commons_category | {{#if:{{# | + | | 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|}}} | | header35 = {{{embedded|}}} | ||
| − | | below = {{EditOnWikidata|qid={{{qid|}}}}} | + | | 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> | }}<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> | {{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. |