Template:Listing: Difference between revisions
restore used classes (some of them also used and required by microformats) |
Space must be rendered in any case, it's just the comma that will be rendered in case of previous information are present |
||
(20 intermediate revisions by 9 users not shown) | |||
Line 1: | Line 1: | ||
<includeonly>< |
<includeonly><bdi class="vcard"><!-- This is a microformat container class. |
||
Anchor |
Anchor |
||
Line 17: | Line 17: | ||
|url={{{url|}}} |
|url={{{url|}}} |
||
|islisting=yes |
|islisting=yes |
||
⚫ | |||
}}<!-- |
}}<!-- |
||
Line 23: | Line 24: | ||
-->{{#if:{{{alt|}}} |
-->{{#if:{{{alt|}}} |
||
|  ({{#ifeq:{{#invoke:IsLatin|IsLatin|{{{alt|}}}}}|yes |
|  ({{#ifeq:{{#invoke:IsLatin|IsLatin|{{{alt|}}}}}|yes |
||
| < |
| <bdi class="nickname listing-alt" style="font-style: italic;">{{{alt|}}}</bdi> |
||
| <bdi class="nickname listing-alt">{{{alt|}}}</bdi>}}) |
| <bdi class="nickname listing-alt">{{{alt|}}}</bdi>}}) |
||
}}<!-- |
}}<!-- |
||
Address |
Address |
||
-->{{#if:{{{address|}}} |
-->{{#if:{{{address|}}} |
||
| {{#if:{{{name|}}}{{{url|}}} |
| {{#if:{{{name|}}}{{{url|}}} |
||
| , |
| , |
||
}}<bdi class="adr listing-address |
}} <bdi class="adr listing-address street-address">{{{address|}}}</bdi> |
||
}}<!-- |
}}<!-- |
||
Line 38: | Line 39: | ||
-->{{#if:{{{directions|}}} |
-->{{#if:{{{directions|}}} |
||
|  ( |
|  (<bdi class="listing-directions" style="font-style: italic;">{{{directions|}}}</bdi>) |
||
}}<!-- |
}}<!-- |
||
Line 45: | Line 46: | ||
-->{{#if:{{{phone|}}} |
-->{{#if:{{{phone|}}} |
||
| {{#if:{{{name|}}}{{{url|}}}{{{address|}}}{{{directions|}}} |
| {{#if:{{{name|}}}{{{url|}}}{{{address|}}}{{{directions|}}} |
||
| , |
| , |
||
}} {{phone|{{{phone|}}}}} |
|||
}}<abbr title="phone" style="text-decoration:none">☎</abbr> <bdi class="tel listing-phone">{{#invoke:LinkPhone|LinkPhone|{{{phone|}}}}}</bdi> |
|||
}}<!-- |
}}<!-- |
||
Line 53: | Line 54: | ||
-->{{#if:{{{tollfree|}}} |
-->{{#if:{{{tollfree|}}} |
||
| {{#if:{{{name|}}}{{{url|}}}{{{address|}}}{{{directions|}}}{{{phone|}}} |
| {{#if:{{{name|}}}{{{url|}}}{{{address|}}}{{{directions|}}}{{{phone|}}} |
||
| , |
| , |
||
}}toll-free: <bdi class="tel listing-tollfree">{{#invoke:LinkPhone|LinkPhone|{{{tollfree|}}}|tollfree=yes}}</bdi> |
}} toll-free: <bdi class="tel listing-tollfree">{{#invoke:LinkPhone|LinkPhone|{{{tollfree|}}}|tollfree=yes}}</bdi> |
||
}}<!-- |
}}<!-- |
||
Line 61: | Line 62: | ||
-->{{#if:{{{fax|}}} |
-->{{#if:{{{fax|}}} |
||
| {{#if:{{{name|}}}{{{url|}}}{{{address|}}}{{{directions|}}}{{{phone|}}}{{{tollfree|}}} |
| {{#if:{{{name|}}}{{{url|}}}{{{address|}}}{{{directions|}}}{{{phone|}}}{{{tollfree|}}} |
||
| , |
| , |
||
}}<span class="tel"><span class="type">fax</span>: <bdi class="value listing-fax">{{#invoke:LinkPhone|LinkPhone|{{{fax|}}}|fax=true}}</bdi></span> |
}} <span class="tel"><span class="type">fax</span>: <bdi class="value listing-fax">{{#invoke:LinkPhone|LinkPhone|{{{fax|}}}|fax=true}}</bdi></span> |
||
}}<!-- |
}}<!-- |
||
Line 69: | Line 70: | ||
-->{{#if:{{{email|}}} |
-->{{#if:{{{email|}}} |
||
| {{#if:{{{name|}}}{{{url|}}}{{{address|}}}{{{directions|}}}{{{phone|}}}{{{tollfree|}}}{{{fax|}}} |
| {{#if:{{{name|}}}{{{url|}}}{{{address|}}}{{{directions|}}}{{{phone|}}}{{{tollfree|}}}{{{fax|}}} |
||
| , |
| , |
||
}} |
}} {{email|{{{email|}}}}} |
||
}}.<!-- |
}}{{#if:{{{inline|}}}||.}}<!-- |
||
Hours |
Hours |
||
Line 105: | Line 106: | ||
-->{{#if:{{{wikipedia|}}}{{{wikidata|}}} |
-->{{#if:{{{wikipedia|}}}{{{wikidata|}}} |
||
| <span class="listing-sister-icons">{{#if:{{{ |
| <span class="listing-sister-icons">{{#if:{{{wikidata|}}} |
||
|  [[File:Wikipedia-icon.png|15px|class=listing-sister|link=w:{{{wikipedia|}}}|<bdi>{{{wikipedia|}}}</bdi> on Wikipedia]] |
|||
⚫ | |||
|  [[File:Wikidata-logo.svg|16px|class=listing-sister|link=d:{{{wikidata|}}}|{{#invoke:Wikibase|label|{{{wikidata|}}}}} ({{{wikidata|}}}) on Wikidata]] |
|  [[File:Wikidata-logo.svg|16px|class=listing-sister|link=d:{{{wikidata|}}}|{{#invoke:Wikibase|label|{{{wikidata|}}}}} ({{{wikidata|}}}) on Wikidata]] |
||
}}{{#ifeq:{{{wikipedia}}}|NA||{{#if:{{{wikipedia|}}}{{#invoke:WikidataIB|getSiteLink|wiki=enwiki|qid={{{wikidata|}}}}} |
|||
⚫ | |||
|  [[File:Antu wikipedia.svg|16px|class=listing-sister|link=w:{{#if:{{{wikipedia|}}}|{{{wikipedia|}}}|{{#invoke:WikidataIB|getSiteLink|wiki=enwiki|qid={{{wikidata|}}}}}}}|<bdi>{{#if:{{{wikipedia|}}}|{{{wikipedia|}}}|{{#invoke:WikidataIB|getSiteLink|wiki=enwiki|qid={{{wikidata|}}}}}}}</bdi> on Wikipedia]] |
|||
⚫ | |||
}}<!-- |
}}<!-- |
||
Line 128: | Line 129: | ||
-->{{#invoke:HiddenUnicode|HiddenUnicode|{{{name}}}{{{lat|}}}{{{long|}}}{{{url|}}}{{{alt|}}}{{{address|}}}{{{directions|}}}{{{phone|}}}{{{tollfree|}}}{{{fax|}}}{{{email|}}}{{{hours|}}}{{{checkin|}}}{{{checkout|}}}{{{price|}}}{{{content|{{{1|}}}}}}}}<!-- |
-->{{#invoke:HiddenUnicode|HiddenUnicode|{{{name}}}{{{lat|}}}{{{long|}}}{{{url|}}}{{{alt|}}}{{{address|}}}{{{directions|}}}{{{phone|}}}{{{tollfree|}}}{{{fax|}}}{{{email|}}}{{{hours|}}}{{{checkin|}}}{{{checkout|}}}{{{price|}}}{{{content|{{{1|}}}}}}}}<!-- |
||
--></bdi>{{#if:{{{wikipedia|}}}| {{#if:{{{wikidata|}}}| | {{#ifeq:{{#invoke:String|find|{{{wikipedia|}}}|#}}|0|[[Category:Listing with Wikipedia link but not Wikidata link]]|}} }} |}}</includeonly><noinclude>{{Documentation}}</noinclude> |
|||
-->{{#invoke:EmailTracking|EmailTracking|email={{{email|}}}}}<!-- |
|||
--></div></includeonly><noinclude>{{Documentation}}</noinclude> |
Latest revision as of 17:29, 18 December 2021
Note to editors: Please don't categorize this template by editing it directly. Instead, place the category in its documentation page, in its "includeonly" section.
This template has a sandbox (edit) for editors to experiment.
Usage
This template is used for implementing generic business listings. There are a few attraction-specific specialized templates which should be used instead, if applicable (see at end of this documentation).
* {{Listing
| type=TYPE OF LISTING (see, do, buy, eat, drink, sleep)
| name=NAME OF LISTING (normally required)
| alt=ALTERNATE NAME (possibly name in a local language)
| wikidata=WIKIDATA QID IDENTIFIER OF THE LISTING
| wikipedia=WIKIPEDIA ARTICLE NAME OF THE LISTING
| url=FULL URL OF LISTING'S WEBSITE (including '''''http[s]://''''' at the start)
| email=EMAIL ADDRESS OF LISTING
| address=PHYSICAL ADDRESS OF LISTING
| lat=LATITUDINAL POSITION OF THE LISTING (positive in the northern hemisphere)
| long=LONGITUDINAL POSITION OF THE LISTING (positive in the eastern hemisphere)
| image=NAME OF IMAGE (for thumbnail displayed when the map marker is clicked – "Image:" or "File:" prefix omitted)
| directions=SHORT DESCRIPTION OF HOW TO GET TO LISTING
| phone=PHONE NUMBER (in international format: +countrycode areacode number)
| tollfree=TOLL-FREE OR FREEPHONE NUMBER (in international format, unless unreachable from abroad)
| fax=FAX NUMBER (in international format)
| hours=OPERATING HOURS OF LISTING
| price=ADMISSION PRICE (range for attractions, one main course for restaurants or one night double occupancy for inns)
| checkin=CHECKIN TIME (sleep listings only)
| checkout=CHECKOUT TIME (sleep listings only)
| lastedit=DATE OF LAST EDIT (in ISO standard format "yyyy-mm-dd", leave this blank if importing info from the venue's website or a secondary source)
| content=BRIEF DESCRIPTION OF THE LISTING
}}
There are no mandatory fields, but it strongly recommended to insert at least one (possibly the name) and preferably more as a {{listing}} with no information is useless to the voyager.
Some caveats:
- Unlike the old XML listing syntax, do not use quotation marks around your entries.
- "lat" and "long" are for WGS84 coordinates' latitude and longitude, respectively (as measured and reported by most GPS receptors). Both are indicated in signed decimal form in degrees (using only an optional leading "+" or "-" sign, basic Latin digits, and "." as decimals separator), see example.
- Do not specify any hemisphere name of abbreviation, use an optional leading sign instead: the "-" sign is required in the southern and western hemispheres; negative longitudes are used in the eastern Pacific Ocean, all the Americas, most of the northern Atlantic Ocean including Iceland, Ireland, western UK and France, the Iberian peninsula and north-western Africa).
- Their value should be in the range from -90 to 90 inclusively for the latitude, and in the range from -180 to 180 for the longitude. The geographic poles conventionally use the arbitrary longitude 0.
- However, world maps rendered for the most commonly used 2D projections (Mercator-like, preserving angles and shapes but not relative surfaces) will not display positions at polar latitudes (below roughly -87.5 degrees, or above roughly 87.5 degrees). Some other maps may render all positions, using projections suitable for specific regions (with their own limits).
Blank template
* {{Listing
| name= | url= | email=
| address= | lat= | long= | directions=
| phone= | tollfree= | fax=
| hours= | price= | image=
| wikipedia=
| wikidata=
| content=
| lastedit=
}}
Microformat
The template emits an hCard microformat.
Example
- 1 Exploratorium, Pier 15, 698 The Embarcadero (at Green St), ☏ +1 415 528-4360. Tu-Su 10AM-5PM; open W until 10PM, closed M. A great kid friendly option, with lots of interactive exhibits teaching about science, with intriguing displays about the mind, natural systems, sound, sight, and much much more. Adults: $25, Students/seniors/youth: $19, Children age 5 and under: Free.
Source:
* {{Listing
| name=Exploratorium | url=http://www.exploratorium.edu/ | email=
| address=Pier 15, 698 The Embarcadero | lat=37.8013 | long=-122.3988 | directions=at Green St
| phone=+1 415 528-4360 | tollfree= | fax=
| hours=Tu-Su 10AM-5PM; open W until 10PM, closed M
| price=Adults: $25, Students/seniors/youth: $19, Children age 5 and under: Free
| image=Giant Mirror at the Exploratorium.jpeg | wikipedia=Exploratorium | wikidata=Q206518
| lastedit=2015-01-15
| content=A great kid friendly option, with lots of interactive exhibits teaching about science, with intriguing displays about the mind, natural systems, sound, sight, and much much more.
}}
Notes:
- This template also allows the insertion of an "edit" link near the end of the generated text. Clicking on it will open a custom form editor to fill in the existing or missing values for supported field values.
- This "edit" link is added by a javascript extension tool (enabled on Wikivoyage), but it will not be visible in simple browsers (for old smartphones or some TV sets) that don't support Javascript, or in any browser whose Javascript has been disabled, or in any page which is not in the main namespace for articles (so it is also not visible in this template documentation page).
Associated template:
- Dependent on Template:Marker for creating a listing's header (item type, number, name, URL). The "zoom" and "group" parameters for the {{Marker}} are not currently supported or passed through by {{Listing}}.
- Lat, long, and wikidata are passed to {{marker}}. With the current behavior of {{marker}}, this means that explicit lat and long values are unnecessary if such values exist on the associated Wikidata item.
Tracking categories
TemplateData
This template is used for implementing business listings.
Parameter | Description | Typ | Status | |
---|---|---|---|---|
Name | name | Name of the listing
| String | required |
Alternative name | alt | Alternative name of the listing (if any)
| String | suggested |
URL | url | URL of listing's website, including http:// at the beginning
| URL | suggested |
email | Email address of the listing | String | suggested | |
Address | address | Postal address of the listing
| String | suggested |
Latitude | lat | Latitudinal position (use decimal notation, WGS84 style). Specify NA when coordinates are not applicable, to disallow fetching the value from wikidata
| Number | suggested |
Longitude | long | Longitudinal position (use decimal notation, WGS84 style). Specify NA when coordinates are not applicable, to disallow fetching the value from wikidata
| Number | suggested |
Directions | directions | Short description of how to get there
| String | suggested |
Telefon | phone | Contact phone number
| String | suggested |
Toll-free | tollfree | Toll-free contact number | String | optional |
Fax | fax | Fax number
| String | optional |
Operating hours | hours | Operating hours of listing
| String | suggested |
Price | price | Admission price
| String | suggested |
Wikipedia article | wikipedia | English Wikipedia article of the listing. Automatically acquired from Wikidata ID if present.
| Page name | optional |
Wikidata link | wikidata | Wikidata QID of the listing
| Number | suggested |
Commons image | image | Wikimedia Commons image of the listing for dynamic maps. Automatically acquired from Wikidata ID if preset. If specifying manually, omit 'File:'
| File | optional |
Last edit | lastedit | Date of last update (use yyyy-mm-dd)
| Date | suggested |
Description | content | Brief description of the listing
| Content | suggested |
See also
- Wikivoyage:Listings
- Wikivoyage:Listing editor, which is dependent on this template and provides a user interface for editing listings
- Source code found at Mediawiki:Gadget-ListingEditor.js
- Attraction-specific type templates, if applicable:
- This template internally depends on Template:Marker