Template:Listing/sandbox
This is the template sandbox page for Template:Listing (diff). |
This template uses Lua: |
Wikivoyage listing wrapper templates | ||||
Location-based: | ◆ | Time-based: | ||
{{Event}} |
The {{Listing}} template is responsible for displaying information about individual local entities that travellers may interact with in a concise, uniform text format, and integrating it into other page elements that organize them using different formats (such as geographical points on a map). It is the generic "backend" used by the all of the type-specific wrapper templates linked above, which preprocess the data supplied for listings before passing them on to this template, silently fixing common mistakes and improving consistency with Wikivoyage standards and policies. (Such as Eat listings use of price range symbols instead of currency values and never having checkout times, and so much more.)
Usage
[edit]It is strongly advised that all editors use the applicable wrapper template instead of this one whenever possible. Of course, unusual cases will always exist in which their implicit assumptions prevent a demonstrably superior end result and this template should be invoked explicitly. As always, use your best judgment and don't be afraid to ask for help on Template talk:Listing/sandbox if things go awry. This template may be fundamentally more versatile and fully-featured than its wrappers, this is achieved at the expense of usability and resilience, and a keen attention to detail is called for when used directly.
Parameters
[edit]Supplementary information regarding this template parameters can be found in the § TemplateData section below.
Name | Description |
---|---|
type
| One of: buy, do, drink, eat, go, see, sleep, city, vicinity or listing (default) |
name
| Name used when dealing with the public, a/k/a trade name or dba (normally required) |
alt
| Alternate names such as former names, vernacular nicknames or rendered in the native language |
lat
| Latitude of primary physical location, in WGS84 format up to 5 decimal places (positive in Northern hemisphere) |
long
| Longitude of primary physical location, in WGS84 format up to 5 decimal places (positive in Eastern hemisphere) |
url
| Canonical URL of official, public website, including protocol (http[s]://) |
email
| Email address from which responses can be reasonably expected from listing's representatives |
address
| Street address of primary physical location, with city if necessary, but not postal code |
directions
| Terse summary of how to successfully navigate the area and find the location, as sentence fragment |
image
| Filename of image on Wikimedia Commons to display when map marker is clicked, without 'File:' namespace prefix |
wikidata
| Wikidata identifier (QID or Q number) for item representing listing, if one exists |
wikipedia
| Title of English Wikipedia page about location, if one exists |
phone
| Telephone number for listing's representatives, formatted as described at WV:PN (+countrycode areacode number) |
tollfree
| Toll-free or Freephone telephone number, formatted as described at WV:PN (unless unreachable from abroad) |
fax
| Phone number to which facsimile (fax) document transmissions may be made using the ITU-T V.34 protocol, formatted as described at WV:PN |
hours
| Publicly posted hours of operation |
checkin
| Time of day at which new guests are able to occupy their accommodation (Sleep listings, only) |
checkout
| Time of day by which departing guests must vacate their accommodation at the conclusion of their stay (Sleep listings only) |
price
| Average financial cost of participation (range for attractions, one main course for restaurants or one night double occupancy for inns), in the currency the visitor will pay in – usually the local currency, sometimes a hard currency |
content
| Brief description and other useful contextual information |
lastedit
| Date when the listing's factual information was last updated or verified, in RFC 3339 format yyyy-mm-dd (leave blank if sourcing information from an official website or secondary source) |
counter
| Explicitly assign the map marker number of the listing irrespective of its position in the article relative to other listings; passed through to the {{Marker}} parameter of the same name |
inline
| Alters the structure of the output for use within the text (prose) of an article rather than a self-contained block element when assigned a "truthy" Boolean value (most notably, by removing the terminal full stop/period (. ) |
There are no mandatory fields from a technical standpoint, but absent unusual circumstances, the |name=
parameter should be treated as such, and both the |url=
and |wikidata=
parameters should also receive values if the listed entity has an official web or Wikidata page, respectively.
Blank template
[edit]When adding new listings to pages using the source editor, you can use the provided Copy button in the upper-right corner to transfer this blank copy of the template to your device's clipboard to then paste into the edit box.
* {{Listing | type =
| name = | alt =
| lat = | long =
| url = | email =
| address = | directions =
| image = | wikidata = | wikipedia =
| phone = | tollfree = | fax =
| hours = | price = | checkin = | checkout =
| content =
| lastedit =
}}
Caveats
[edit]- 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).
Notes
[edit]- 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).
- Though this template calls {{Marker}} to create a listing's header (item type, number, name, URL), that template's
|zoom=
and|group=
parameters are not passed through to it, and this, are unsupported. - If
|wikidata=
is defined and the Wikidata item has an accurate value for the coordinate location property, it will be used as|lat=
and|long=
of this template, unless they are explicitly given; please do confirm their accuracy. They can be copied either way by the listing editor's "sync shared fields" functionality.
Examples
[edit]- 1 Gangaur Sweets, J-32, Subash Marg, C-Scheme, ☏ +91 141-382-835. Sweets for chamcham, also baked sweets and crispy samosas. ₹180–580 per order.
* {{eat
| name=Gangaur Sweets | url= | email=
| address=J-32, Subash Marg, C-Scheme | lat=26.9077 | long=75.7990 | directions=
| phone=+91 141-382-835 | tollfree= | fax=
| hours= | price=₹180–580 per order
| lastedit=2015-04-19
| content= Sweets for chamcham, also baked sweets and crispy samosas.
}}
- 1 Ekeberg Camping, Ekebergveien 65 (Bus 34, 46 or 74 to Ekeberg Camping. The trip takes 10 minutes from Central Station.), ☏ +47 22 19 85 68, ekeberg@naf.no. Check-in: 07:30–23:00. Open 1 Jun–1 Sep. The closest campsite to central Oslo. Beautiful view of the city. No cabins. Owned by the Norwegian Automobile Federation. Mini-golf and horse rental. Fully equipped sanitary facilities: showers with hot and cold water, toilets, kitchen, launderette. 2-person tent: kr 185, 4-person tent with car: kr 270.
* {{sleep
| name=Ekeberg Camping | alt= | url=http://www.ekebergcamping.no/ | email=ekeberg@naf.no
| address=Ekebergveien 65 | lat=59.89835 | long=10.77444 | directions=Bus 34, 46 or 74 to Ekeberg Camping. The trip takes 10 minutes from Central Station.
| phone=+47 22 19 85 68 | tollfree= | fax=
| checkin=07:30 to 23:00 | checkout= | price=2-person tent: kr 185, 4-person tent with car: kr 270
| lastedit=2015-04-19
| content=Open Jun–Sep. The closest campsite to central Oslo. Beautiful view of the city. No cabins. Owned by the Norwegian Automobile Federation. Mini-golf and horse rental. Fully equipped sanitary facilities: showers with hot and cold water, toilets, kitchen, launderette.
}}
- 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.
* {{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.
}}
TemplateData
[edit]This is the TemplateData for Template:Listing/sandbox, for use by TemplateWizard, VisualEditor and other tools.
Template description
This template is used for implementing business listings.
Parameter | Description | Type | Status | |
---|---|---|---|---|
Type | type | Adds listing to one of several established presentation groups
| Line | suggested |
Name | name | Name used by entity to identify itself to the public, also known as a 'trade name', 'operating name' or 'dba'
| Line | required |
Latitude | lat | The latitude of the listing's primary physical location in decimal notation (WGS84 style) with max. 5 places, or set to 'NA' to bypass fetching the value from Wikidata
| Number | suggested |
Longitude | long | The longitude of the listing's primary physical location using decimal notation (WGS84 style) with max. 5 places, or set to 'NA' to bypass fetching the value from Wikidata
| Number | suggested |
Commons image | image | Name of file on Wikimedia Commons to show when the listing is clicked on dynamic maps, otherwise it will be acquired from Wikidata if possible; do not include the 'File:' namespace prefix
| File | optional |
Website | url | URL of the listing's official public website, including the protocol ('http://' or 'https://')
| URL | suggested |
Wikidata item | wikidata | Wikidata identifier (QID or 'Q number') for item representing the listing
| Line | suggested |
Alternative name | alt | Other name(s) the listing may be known to the public as (if any), such as former names or local nicknames
| Line | optional |
Street address | address | Street address of the listing's primary physical location, typically without city and never including the postal code
| Line | suggested |
Driving directions | directions | A terse description of how to find the location, if warranted, formatted as a sentence fragment (sans initial capital and terminating punctuation)
| Line | optional |
Phone number | phone | Listing's primary telephone number, formatted as described in [[WV:PN]]
| Line | suggested |
Toll-free number | tollfree | Toll-free phone number for contacting the listing, if available
| Line | optional |
Fax number | fax | Contact number where the listing accepts facsimile (fax) document transmissions using the ITU-T V.34 protocol
| Line | optional |
email | Email address of the listing | String | suggested | |
Operating hours | hours | Operating hours of listing
| String | suggested |
Check-in time | checkin | Time of day when sleep listing begins allowing new guests into their accomodation
| Line | optional |
Check-out time | checkout | Time of day when sleep listing requires departing guests to relinquish their accomodation to avoid further charges
| Line | optional |
Description | content 1 | Brief description of the listing
| Content | suggested |
Price | price | Admission price
| String | suggested |
Wikipedia article | wikipedia | Name of an English Wikipedia article about the listing; acquired from Wikidata (if present)
| Page name | optional |
Last edited | lastedit | Date when the listing's factual information was last updated or verified, in RFC 3339 format (yyyy-mm-dd)
| Date | suggested |
Marker number | counter | Assigns a particular marker number, overriding the default based on listing type + article placement
| Number | optional |
Inline | inline | When assigned any value, modifies listing for display as part of a sentence or other prosaic context, suspending the use of full stops (periods) as data element separators
| Line | optional |
Microformat
[edit]The template emits an hCard microformat.
Tracking categories
[edit]See also
[edit]- 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
- {{Marker}} (used by this template to generate associated markers for {{Mapframe}})