Difference between revisions of "Template:Infobox telescope/sandbox"
Jump to navigation
Jump to search
imported>Frietjes m |
imported>Uzume (Module:WikidataIB remove usage of deprecated "getPreferredValue") |
||
| (2 intermediate revisions by one other user not shown) | |||
| Line 5: | Line 5: | ||
| title = {{#if:{{{child|}}}||{{{name|{{#if:{{#invoke:Wikidata|ViewSomething|labels|en|value}}|{{#invoke:Wikidata|ViewSomething|labels|en|value}}|{{PAGENAMEBASE}}}}}}}}} | | title = {{#if:{{{child|}}}||{{{name|{{#if:{{#invoke:Wikidata|ViewSomething|labels|en|value}}|{{#invoke:Wikidata|ViewSomething|labels|en|value}}|{{PAGENAMEBASE}}}}}}}}} | ||
| header1 = {{#if:{{{child|}}}|{{{name|{{#invoke:WikidataIB |getLabel |{{{qid|}}}}}}}}}} | | header1 = {{#if:{{{child|}}}|{{{name|{{#invoke:WikidataIB |getLabel |{{{qid|}}}}}}}}}} | ||
| − | | image1 = {{#if:{{{child|}}}||{{#invoke:InfoboxImage|InfoboxImage|image={{#invoke:WikidataIB | | + | | image1 = {{#if:{{{child|}}}||{{#invoke:InfoboxImage|InfoboxImage|image={{#invoke:WikidataIB |getValue|rank=best|P18 |name=image |qid={{{qid|}}} |suppressfields={{{suppressfields|<noinclude>image</noinclude>}}} |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:{{{child|}}}||{{#if:{{{image|}}}|{{{caption|}}}|{{If first display both|{{{caption|{{#invoke:Wikidata|getImageLegend|qid={{{qid|}}}|FETCH_WIKIDATA}}}}}|{{#ifeq:{{{refs|no}}}|yes|{{wikidata|references|normal+|{{{qid|}}}|P18}} }} }} }}}} | | caption1 = {{#if:{{{child|}}}||{{#if:{{{image|}}}|{{{caption|}}}|{{If first display both|{{{caption|{{#invoke:Wikidata|getImageLegend|qid={{{qid|}}}|FETCH_WIKIDATA}}}}}|{{#ifeq:{{{refs|no}}}|yes|{{wikidata|references|normal+|{{{qid|}}}|P18}} }} }} }}}} | ||
| − | | 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={{{image size|{{{image_size|{{{imagesize|}}}}}}}}}|sizedefault=frameless|upright={{{image_upright|1}}}|alt={{{logo_alt|}}}|suppressplaceholder=yes}} |
| caption2 = {{{logo_caption|}}} | | caption2 = {{{logo_caption|}}} | ||
| label2 = Alternative names | | label2 = Alternative names | ||
| − | | data2 = {{#if:{{{child|}}}||{{#if:{{#invoke:WikidataIB| | + | | data2 = {{#if:{{{child|}}}||{{#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|}}} }}|{{#if:{{#invoke:Wikidata|ViewSomething|aliases|en|1|value}}|{{#invoke:Wikidata|ViewSomething|aliases|en|1|value}}{{EditAtWikidata|qid={{{qid|}}} }}|}} }}}} |
| label3 = Named after | | label3 = Named after | ||
| − | | data3 = {{If first display both|{{#invoke:WikidataIB| | + | | data3 = {{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}} }} }} |
| − | | label4 = | + | | label4 = Part of |
| − | | data4 = {{#if:{{{child|}}}||{{If first display both|{{#invoke:WikidataIB| | + | | data4 = {{#if:{{{child|}}}||{{If first display both|{{#invoke:WikidataIB|getValue|rank=best|P361|name=observatory|qid={{{qid|}}}|sep="<br />"|sorted=yes|suppressfields={{{suppressfields|}}}|fetchwikidata={{{fetchwikidata|ALL}}}|onlysourced={{{onlysourced|no}}}|{{{observatory|{{{observatory|}}}}}}}}|{{#ifeq:{{{refs|no}}}|yes|{{wikidata|references|normal+|{{{qid|}}}|P361}} }} }}}} |
| label5 = Location(s) | | label5 = Location(s) | ||
| class5 = label | | class5 = label | ||
| − | | data5 = {{Wikidata location|suppressfields={{{suppressfields|}}}|fetchwikidata={{{fetchwikidata|ALL}}}|onlysourced={{{onlysourced|no}}}|location={{{location|}}}|qid={{{qid|}}}}} | + | | data5 = {{#invoke:Wikidata Infobox|ifThenShow | <!-- |
| + | -->{{#ifeq:{{#invoke:WikidataIB | getValue | rank=best | P131 | name=adminunit | qid={{#invoke:WikidataIB |getQid |qid={{{qid|}}} }} | spf={{{spf|}}} | fwd={{{fwd|ALL}}} | osd={{{osd|no}}} | maxvals=1}}|{{#invoke:WikidataIB | getValue | rank=best | P131 | name=adminunit | qid={{#invoke:WikidataIB |getQid |qid={{{qid|}}} }} | spf={{{spf|}}} | fwd={{{fwd|ALL}}} | osd={{{osd|no}}}}}|<!-- | ||
| + | -->{{#ifeq:{{#invoke:WikidataIB | getValue | rank=best | P276 | name=adminunit | qid={{#invoke:WikidataIB |getQid |qid={{{qid|}}} }} | spf={{{spf|}}} | fwd={{{fwd|ALL}}} | osd={{{osd|no}}} | maxvals=1}}|{{#invoke:WikidataIB | getValue | rank=best | P276 | name=adminunit | qid={{#invoke:WikidataIB |getQid |qid={{{qid|}}} }} | spf={{{spf|}}} | fwd={{{fwd|ALL}}} | osd={{{osd|no}}}}}|<!-- | ||
| + | -->{{#invoke:Wikidata Infobox|ifThenShow|{{#invoke:WikidataIB | location | {{#invoke:WikidataIB |getQid |qid={{{qid|}}} }}}}|{{Wikidata location | qid={{#invoke:WikidataIB |getQid |qid={{{qid|}}} }}|suppressfields={{{suppressfields|}}}|fetchwikidata={{{fetchwikidata|ALL}}}|onlysourced={{{onlysourced|no}}}|location={{{location|}}} }}}} |<!-- | ||
| + | -->{{Wikidata location | qid={{#invoke:WikidataIB |getQid |qid={{{qid|}}} }}|suppressfields={{{suppressfields|}}}|fetchwikidata={{{fetchwikidata|ALL}}}|onlysourced={{{onlysourced|no}}}|location={{{location|}}} }} }} | <!-- | ||
| + | -->{{Wikidata location | qid={{#invoke:WikidataIB |getQid |qid={{{qid|}}} }}|suppressfields={{{suppressfields|}}}|fetchwikidata={{{fetchwikidata|ALL}}}|onlysourced={{{onlysourced|no}}}|location={{{location|}}} }} }}<!-- | ||
| + | --> }} | ||
| label6 = Coordinates | | label6 = Coordinates | ||
| Line 28: | Line 34: | ||
| label7 = Organization | | label7 = Organization | ||
| − | | data7 = {{If first display both|{{#invoke:WikidataIB| | + | | data7 = {{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}} }} }} |
| label8 = [[List of observatory codes|Observatory code]] | | label8 = [[List of observatory codes|Observatory code]] | ||
| − | | data8 = {{#invoke:WikidataIB | | + | | data8 = {{#invoke:WikidataIB |getValue|rank=best|P717|name=code|qid={{{qid|}}}|suppressfields={{{suppressfields|}}}|fetchwikidata={{{fetchwikidata|ALL}}}|onlysourced={{{onlysourced|no}}}|lp="[List of observatory codes#" |linkpostfix={{!}} |postfix="]"|{{{code|}}}}} |
| label9 = Altitude | | label9 = Altitude | ||
| Line 37: | Line 43: | ||
| label10 = Observing time | | label10 = Observing time | ||
| − | | data10 = {{{obs-time|{{#if:{{#Property:P3891|from={{{qid|}}}}} | {{If first display both|{{#invoke:WikidataIB | | + | | data10 = {{{obs-time|{{#if:{{#Property:P3891|from={{{qid|}}}}} | {{If first display both|{{#invoke:WikidataIB |getValue|rank=best|P3891 |name=obs-time |fetchwikidata={{{fetchwikidata|ALL}}} |suppressfields={{{suppressfields|}}} |onlysourced={{{onlysourced|no}}} }} }}|{{#ifeq:{{{refs|no}}}|yes|{{wikidata|references|normal+|{{{qid|}}}|P3891}} }} }} }}} |
| label11 = [[Wavelength]] | | label11 = [[Wavelength]] | ||
| − | | data11 = {{{wavelength|{{#if:{{#property:P3738|from={{{qid|}}}}}|{{convert|input=P3738|qid={{{qid|}}}|frequency|abbr=on}}{{#ifeq:{{{refs|no}}}|yes|{{wikidata|references|normal+|{{{qid|}}}|P3738}}}}-{{convert|input=P3737|qid={{{qid|}}}|frequency|abbr=on}}{{#ifeq:{{{refs|no}}}|yes|{{wikidata|references|normal+|{{{qid|}}}|P3737}}}}|{{#if:{{#property:P2808|from={{{qid|}}}}}|{{convert|input=P2808|qid={{{qid|}}}|frequency|abbr=on}}{{#ifeq:{{{refs|no}}}|yes|{{wikidata|references|normal+|{{{qid|}}}|P2808}} }} | {{convert|input=P2144|qid={{{qid|}}}|wavelength|abbr=on}}{{#ifeq:{{{refs|no}}}|yes|{{wikidata|references|normal+|{{{qid|}}}|P2144}} }} | {{#invoke:WikidataIB| | + | | data11 = {{{wavelength|{{#if:{{#property:P3738|from={{{qid|}}}}}|{{convert|input=P3738|qid={{{qid|}}}|frequency|abbr=on}}{{#ifeq:{{{refs|no}}}|yes|{{wikidata|references|normal+|{{{qid|}}}|P3738}}}}-{{convert|input=P3737|qid={{{qid|}}}|frequency|abbr=on}}{{#ifeq:{{{refs|no}}}|yes|{{wikidata|references|normal+|{{{qid|}}}|P3737}}}}|{{#if:{{#property:P2808|from={{{qid|}}}}}|{{convert|input=P2808|qid={{{qid|}}}|frequency|abbr=on}}{{#ifeq:{{{refs|no}}}|yes|{{wikidata|references|normal+|{{{qid|}}}|P2808}} }} | {{convert|input=P2144|qid={{{qid|}}}|wavelength|abbr=on}}{{#ifeq:{{{refs|no}}}|yes|{{wikidata|references|normal+|{{{qid|}}}|P2144}} }} | {{#invoke:WikidataIB|getValue|rank=best|P1227|name=wavelength|suppressfields={{{suppressfields|}}}|fetchwikidata={{{fetchwikidata|ALL}}}|onlysourced={{{onlysourced|no}}}|{{{wavelength|}}}}}{{#ifeq:{{{refs|no}}}|yes|{{wikidata|references|normal+|{{{qid|}}}|P1227}} }} {{EditAtWikidata|pid=P3738|qid={{{qid|}}} }} }} }} }}} |
| label12 = Built | | label12 = Built | ||
| Line 46: | Line 52: | ||
| label13 = [[First light (astronomy)|First light]] | | label13 = [[First light (astronomy)|First light]] | ||
| − | | data13 = {{If first display both|{{#invoke:WikidataIB| | + | | data13 = {{If first display both|{{#invoke:WikidataIB|getValue|rank=best|P729|name=first_light|qid={{{qid|}}}|suppressfields={{{suppressfields|}}}|fetchwikidata={{{fetchwikidata|ALL}}}|onlysourced={{{onlysourced|no}}}|{{{first_light|}}}}}|{{#ifeq:{{{refs|no}}}|yes|{{wikidata|references|normal+|{{{qid|}}}|P729}} }} }} |
| label14 = Decommissioned | | label14 = Decommissioned | ||
| − | | data14 = {{If first display both|{{#invoke:WikidataIB| | + | | data14 = {{If first display both|{{#invoke:WikidataIB|getValue|rank=best|P576|name=decommissioned|qid={{{qid|}}}|suppressfields={{{suppressfields|}}}|fetchwikidata={{{fetchwikidata|ALL}}}|onlysourced={{{onlysourced|no}}}|{{{decommissioned|}}}}}|{{#ifeq:{{{refs|no}}}|yes|{{wikidata|references|normal+|{{{qid|}}}|P576}} }} }} |
| label15 = Discovered | | label15 = Discovered | ||
| Line 56: | Line 62: | ||
| label16 = Telescope style | | label16 = Telescope style | ||
| class16 = category | | class16 = category | ||
| − | | data16 = {{If first display both|{{#invoke:WikidataIB| | + | | data16 = {{If first display both|{{#invoke:WikidataIB|getValue|rank=best|P31|name=style|qid={{{qid|}}}|sep="<br />"|sorted=yes|suppressfields={{{suppressfields|}}}|fetchwikidata={{{fetchwikidata|ALL}}}|onlysourced={{{onlysourced|no}}}|{{{style|}}}}}|{{#ifeq:{{{refs|no}}}|yes|{{wikidata|references|normal+|{{{qid|}}}|P31}} }} }} |
| label17 = Number of telescopes | | label17 = Number of telescopes | ||
| Line 87: | Line 93: | ||
| label25 = [[Angular resolution]] | | label25 = [[Angular resolution]] | ||
| − | | data25 = {{If first display both|{{#invoke:WikidataIB| | + | | data25 = {{If first display both|{{#invoke:WikidataIB|getValue|rank=best|P3439|name=angular_resolution|suppressfields={{{suppressfields|}}}|fetchwikidata={{{fetchwikidata|ALL}}}|onlysourced={{{onlysourced|no}}}|{{{angular_resolution|}}}}}|{{#ifeq:{{{refs|no}}}|yes|{{wikidata|references|normal+|{{{qid|}}}|P3439}} }} }} |
| label26 = Collecting area | | label26 = Collecting area | ||
| Line 103: | Line 109: | ||
| label30 = Enclosure | | label30 = Enclosure | ||
| − | | data30 = {{If first display both|{{#invoke:WikidataIB| | + | | data30 = {{If first display both|{{#invoke:WikidataIB|getValue|rank=best|P3158|name=dome|qid={{{qid|}}}|suppressfields={{{suppressfields|}}}|fetchwikidata={{{fetchwikidata|ALL}}}|onlysourced={{{onlysourced|no}}}|{{{dome|}}}}}|{{#ifeq:{{{refs|no}}}|yes|{{wikidata|references|normal+|{{{qid|}}}|P3158}} }} }} |
| label31 = Replaced | | label31 = Replaced | ||
| − | | data31 = {{If first display both|{{#invoke:WikidataIB| | + | | data31 = {{If first display both|{{#invoke:WikidataIB|getValue|rank=best|P1365|name=replaced|qid={{{qid|}}}|suppressfields={{{suppressfields|}}}|fetchwikidata={{{fetchwikidata|ALL}}}|onlysourced={{{onlysourced|no}}}|{{{replaced|}}}}}|{{#ifeq:{{{refs|no}}}|yes|{{wikidata|references|normal+|{{{qid|}}}|P1365}} }} }} |
| label32 = Replaced by | | label32 = Replaced by | ||
| − | | data32 = {{If first display both|{{#invoke:WikidataIB| | + | | data32 = {{If first display both|{{#invoke:WikidataIB|getValue|rank=best|P1366|name=replacedby|qid={{{qid|}}}|suppressfields={{{suppressfields|}}}|fetchwikidata={{{fetchwikidata|ALL}}}|onlysourced={{{onlysourced|no}}}|{{{replacedby|}}}}}|{{#ifeq:{{{refs|no}}}|yes|{{wikidata|references|normal+|{{{qid|}}}|P1366}} }} }} |
| label33 = Website | | label33 = Website | ||
| Line 118: | Line 124: | ||
| header35 = {{{nrhp|{{{embedded|{{{module|}}}}}}}}} | | header35 = {{{nrhp|{{{embedded|{{{module|}}}}}}}}} | ||
| − | | data36 = | + | | data36 = {{{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}} }}}}} |
| below = {{#if:{{{child|}}}||{{EditOnWikidata}}}} | | below = {{#if:{{{child|}}}||{{EditOnWikidata}}}} | ||
| − | }}{{#invoke:Check for unknown parameters|check|unknown={{main other|[[Category:Pages using infobox telescope with unknown parameters|_VALUE_{{PAGENAME}}]]}}|preview=Page using [[Template:Infobox telescope]] with unknown parameter "_VALUE_"|ignoreblank=y| alt | altitude | angular_resolution | area | built | caption | child | code | commons | coordinates | coords | decommissioned | diameter | diameter2 | diameter3 | dome | embedded | first_light | focal_length | illuminatedarea | illuminateddiameter | image | image_size | length | location | locmapin | logo | module | mounting | name | nrhp | namedafter | onlysourced | observatory | organisation | organization | qid | refs | style | suppressfields | wavelength | website | width}}<includeonly>{{main other|{{#if:{{safesubst:#invoke:Check for unknown parameters|check|unknown=1|preview=1|locmapin}}|[[Category:Articles using Infobox telescope using locally defined parameters]]|[[Category:Articles with infoboxes completely from Wikidata]]}}}}</includeonly><noinclude> | + | }}{{#invoke:Check for unknown parameters|check|unknown={{main other|[[Category:Pages using infobox telescope with unknown parameters|_VALUE_{{PAGENAME}}]]}}|preview=Page using [[Template:Infobox telescope]] with unknown parameter "_VALUE_"|ignoreblank=y| alt | altitude | angular_resolution | area | built | caption | child | code | commons | coordinates | coords | decommissioned | diameter | diameter2 | diameter3 | discovered | dome | embedded | first_light | focal_length | illuminatedarea | illuminateddiameter | image | image_size | length | location | locmapin | logo | module | mounting | name | nrhp | namedafter | onlysourced | observatory | organisation | organization | qid | refs | style | suppressfields | wavelength | website | width}}<includeonly>{{main other|{{#if:{{safesubst:#invoke:Check for unknown parameters|check|unknown=1|preview=1|locmapin}}|[[Category:Articles using Infobox telescope using locally defined parameters]]|[[Category:Articles with infoboxes completely from Wikidata]]}}}}</includeonly><noinclude> |
{{documentation}} | {{documentation}} | ||
</noinclude> | </noinclude> | ||
Latest revision as of 16:26, 13 September 2020
| Alternative names | Script error: No such module "Wikidata".Script error: No such module "EditAtWikidata". |
|---|---|
| Location(s) | Lua error in Module:WikidataIB at line 1528: attempt to index field 'wikibase' (a nil value). |
| Coordinates | Lua error in Module:Coordinates at line 611: attempt to index field 'wikibase' (a nil value).Script error: No such module "EditAtWikidata". |
| Wavelength | - |
| Diameter | Script error: No such module "EditAtWikidata". |
| Website | Template:UrlScript error: No such module "EditAtWikidata". |
| Template:Wikidata location map | |
| This is the template sandbox page for Template:Infobox telescope (diff). |
| This template uses Lua: |
- redirect Template:Parameter names example
Usage
Just add:
{{infobox telescope}}
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 telescope
| name =
}}
The full list of parameters is:
Template data
Microformat
Tracking categories
- Category:Pages using infobox telescope with unknown parameters (0)
- Category:Articles with infoboxes completely from Wikidata (0)
- Category:Articles using Infobox telescope using locally defined parameters (0)
See also
| The above documentation is transcluded from Template:Infobox telescope/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. |