Logo Voyage

Wikivoyage:Listing editor Voyage Tips and guide

You can check the original Wikivoyage article Here

This is a form-based listing editor that can be used to add and edit listings. See also Wikivoyage:Listings.

How to use

[edit]

Each listing can be described by entering the following into the listings form.

  • Name: the name of the hotel, bar, restaurant, museum, or whatever. Recommended.
  • Alt: an alternative name, either in the local language or just an alternative. Optional.
  • Website: the URL for the official Web site for this attraction (see external links for more guidelines). Recommended.
  • Address: a street address for finding the attraction, for places where this is meaningful. Recommended.
  • Directions: additional brief directions besides the street address, such as cross streets, nearby subway or bus stations. Optional.
  • Phone: a phone number for making reservations or getting more information. Recommended.
  • Tollfree: a toll-free phone number, if available. Optional.
  • Email: an email address for making reservations or getting more information. Optional.
  • Latitude: Decimal latitude (GPS coordinates) for map output. Recommended.
  • Longitude: Decimal longitude (GPS coordinates) for map output. Recommended.
    • Note: lat and long should have the same number of decimal places (using trailing zeroes if applicable). If one is present, so should the other be. Click on the link to GeoMap for easy access to a OSM-based locator. Google Maps coordinates are highly discouraged.
  • Hours: opening hours of the attraction, when applicable. Recommended.
  • Price: price of a room, or price of a drink, or price of an average meal, or price of admission. Recommended.
  • Wikidata: the Wikidata page for the attraction, if one exists. This field should only be used if a record for the specific location exists—for example, a link to the Wikidata record for the Raffles Hotel would be appropriate, but a link for the McDonald's company Wikidata page is not.
  • Wikipedia: the Wikipedia page for the attraction, if one exists. Again, do not provide a value to a brand or company page; only provide a value if a Wikipedia page for the specific location exists.
  • Image: an image on Commons that will be displayed for the listing's point of interest on the dynamic map. Note that the value specified should exclude the "File:" namespace for the image ("Example.png", not "File:Example.png"). Like the Wikidata and Wikipedia fields, do not provide generic images; only provide an image if it is of the specific location.
  • Update shared fields using values from Wikidata: This link is only present if a Wikidata value has been entered. If clicked it will sync any existing values in the fields marked with the Wikidata logo with values from the shared Wikidata record.
  • Mark the listing as up-to-date?: check this checkbox if the information in the listing has been verified as being up-to-date; doing so will cause the "last edit" date for the listing to update to the current date. Optional.
  • Delete this listing?: check this checkbox if the business is no longer in operation, and the listing will be removed from the article. Optional.
  • Edit summary: a brief description of the changes being made that will be recorded in the article history. Recommended.
  • Minor change?: a checkbox that can be used to indicate that an edit is minor, such as when fixing a typo. Optional.

There are several other parameters described at Wikivoyage:Listings.

Features

[edit]
Before opening listing editor
After clicking the edit button for a listing

Forms are familiar features to users, allowing for specific parameters to be shown or hidden, and providing extra functionality like links to help pages. The editor allows for flexibility of templates, relying more heavily on wikitext instead of the actual HTML structure. It targets listings with span class="vcard", and their corresponding names (span class="org"), addresses (span class="label") and alternative nicknames (span class="nickname"). Targeted geocoding can be achieved by including <span id="geodata">lat; long</span> inside a separate {{geo}} or quickbar template.

  • Adds [add listing] buttons to second and third-level headings of articles without 'Cities' or 'Other destinations' (will add listing to topics with 'See', 'Do', 'Buy', 'Eat', 'Sleep' and 'Connect' headings', even travel topics)
  • Assigns type based on heading names
  • Adds grey edit button to listings
  • Opens form that lists parameters of the {{listing}} template.
  • Automatic edit summary

Bugs and feedback

[edit]

Please discuss bugs and feedback to the listing editor at Wikivoyage talk:Listing editor or at GitHub issues.

How to install

[edit]

Wikivoyage in English has the gadget (the working 2023 version) installed and activated by default: see "2023 listing editor" among the gadgets in your preferences.

Forking to other projects

[edit]

Try testing as a non-default gadget for testing before sitewide implementation in MediaWiki namespace. Other projects can add the listing editor with the following edits (please follow these instructions carefully):

MediaWiki:Gadget-ListingEditor2023

Create to describe the listing editor in Preferences > Gadgets.

MediaWiki:Gadget-ListingEditor2023.js
importScriptURI('https://en.wikivoyage.org/w/load.php?modules=ext.gadget.ListingEditor2023');
MediaWiki:Gadget-ListingEditor2023.css
@import url('//en.wikivoyage.org/w/index.php?title=MediaWiki:Gadget-ListingEditor2023.css&action=raw&ctype=text/css');
MediaWiki:Gadget-ListingEditorConfig.js

Copy to your local wiki. Do not edit.

MediaWiki:Gadget-ListingEditor.json

Copy to your local wiki and edit as per documentation.

MediaWiki:Gadgets-definition
* ListingEditor2023[ResourceLoader|default|type=general|dependencies=ext.gadget.ListingEditor2023Styles,ext.gadget.ListingEditorConfig,mediawiki.storage,mediawiki.user]|ListingEditor2023.js
* ListingEditor2023Styles[ResourceLoader|default|hidden|type=general]|ListingEditor2023.css
* ListingEditorConfig[ResourceLoader|package|hidden]|ListingEditorConfig.js|ListingEditor.json

Translations

[edit]

Translations currently need to be added in the code itself. In future it is hoped this can be connected to automated translations from TranslateWiki.

Configuration

[edit]

The MediaWiki:Gadget-ListingEditor.json page contains parameters that must be customized for each language.

Parameter Type Description Example
SHOW_LAST_EDITED_FIELD Boolean Controls whether the "Last Updated" field is displayed in the editor form. If true, users can see and update the last edit date. true
SUPPORTED_SECTIONS Array<String> A list of supported listing types that the editor recognizes. These usually correspond to the template names (e.g., see, do). ["see", "do", "eat"]
sectionType Object Maps specific Wikivoyage section headers (keys) to the listing template type (values) that should be used for new listings created in that section. {"See": "see", "Do": "do"}
iata String Template string used for formatting IATA airport codes. %s is replaced by the code. "{{IATA|%s}}"
listingTypeRegExp String (Regex) A regular expression used to identify listing templates within the wikitext. %s is dynamically replaced by the pipe-separated list of SUPPORTED_SECTIONS. "({{\\s*(%s)\\b)(\\s*[\\|}])"
(rendered as "({{\s*(%s)\b)(\s*[|}])")
APPEND_FULL_STOP_TO_DESCRIPTION Boolean If set to true, the editor automatically appends a period (full stop) to the end of the description if one is missing. false
REPLACE_NEW_LINE_CHARS Boolean If set to true, newlines entered in the description field are converted to <br /> tags when saving to wikitext. true
LISTING_TEMPLATES_OMIT Array<String> A list of listing types defined in SUPPORTED_SECTIONS that should be excluded from standard processing or dropdowns. []
VALIDATE_CALLBACKS_EMAIL Boolean Enables basic regex validation for the email field if set to true. false
SUBMIT_FORM_CALLBACKS_UPDATE_LAST_EDIT Boolean If set to true, the "last edit" date is automatically updated to the current date when the form is submitted. true
ALLOW_UNRECOGNIZED_PARAMETERS_LOOKUP Boolean If true, parameters found in the wikitext that are not explicitly defined in the configuration are preserved (passed through) rather than deleted. true
LISTING_TYPE_PARAMETER String The name of the parameter used to define the listing type in the template (e.g., {{listing|type=see|...}}). "type"
LISTING_CONTENT_PARAMETER String The name of the parameter used for the listing description/content. "content"
DEFAULT_LISTING_TEMPLATE String The default template name to use if a specific type cannot be determined or for generic listings. "listing"
SLEEP_TEMPLATE_PARAMETERS Object Specific configuration overrides for "sleep" listings. Typically used to replace standard fields (like "hours") with accommodation-specific fields (like "checkin"/"checkout"). {"hours": { "hideDivIfEmpty": "div_hours" }}
LISTING_TEMPLATE_PARAMETERS Object Defines the schema for the editor form fields. Keys are parameter names. Values define properties like id (HTML input ID), hideDivIfEmpty, newline (formatting), and skipIfEmpty. {"name": {"id": "input-name"}}
WIKIDATAID String The Wikidata QID for the specific Wikivoyage language version (e.g., English Wikivoyage). Used for attributing data imported from Wikidata. "19826574"
SPECIAL_CHARS Array<String> A list of special characters or symbols that are displayed as clickable links in the editor to easily insert them into text fields. []

Changelog

[edit]

Release notes can be found on github.

Historic changelog

[edit]

The following relate to release notes on older versions.

v3.7.1 Changes

[edit]
  • Prevent to add a trailing period to a string that has only blank spaces

v3.7.0 Changes

[edit]
  • Restore DMS format management, implemented in v2.4
  • Fix "Auto select" bug in Wikidata Sync pop-up window

v3.6.0 Changes

[edit]

v3.4.0 Changes

[edit]

v3.3.1 Changes

[edit]

v3.3.0 Changes

[edit]

v3.0.0 Changes

[edit]

v2.4.2 Changes

[edit]
  • Fix "Add trailing period in content" when "?" or "!" is present

v2.4.1 Changes

[edit]
  • Added link to commons to easily access, see and compare images in "WD sync" window
  • Avoid false positive when compare two images where the local one is written with underscores in place of spaces
  • Coords in decimal format cannot exceed 6 digits (note: 6 digits have an accuracy of ~11 cm)

v2.4 Changes

[edit]
  • Table to Div form conversion
  • DMS notation supported (used in it:voy & de:voy)
  • Restore geomap-link functionality and update in realtime the coords. Use the best available coords between listing and article one
  • Close sync form when main listing editor form is closed
  • Skip validation form process upon deletion request
  • Allow edit summary also during ADD phase to provide credit or other info
  • Fix lint & HTML errors generated dynamically
  • Coords nullify link removed
  • Add trailing period in content
  • Update or hide correctly Wikipedia/Commons links after WD sync
  • Prevent editing issues when '$&' sequence is present in the listing
  • Prevent JS error when first listing value has no parameter
  • Wmflabs -> toolforge URL migration to avoid useless redirect
  • Use of global/local variables in place of hard coding
  • CSS & style cleanup
  • Minor cleanups

v2.3 Changes

[edit]
  • Import shortcut for national currency, national calling code and local calling code from Italian Wikivoyage
  • Fix multilingual incompatibility between updateWikidataSharedFields and the older quickUpdateWikidataSharedFields
  • Minor cleanups

v2.2 Changes

[edit]
  • Create bidirectional Wikidata Sync window with reference support
  • Automatically fill IATA code for airports if Alt is empty
  • Sync directions with Wikidata
  • Trim period from price and address
  • Import preview functionality from German Wikivoyage
  • Add button to get Wikidata ID from given Wikipedia article
  • Add button to replace coordinates with NA
  • Fx linterrors by phasing out <p> in favor of <br>
  • Minor cleanup of template format
  • Display color in type selectors
  • Detect RTL text in alt field
  • Support go as listing type

v2.1 Changes

[edit]
  • Wikidata & Wikipedia fields added.
  • The Wikidata, image, and Wikipedia fields will now autocomplete, with lookups done by searching the relevant site.
  • Latitude, longitude, official link, wikipedia link, and image can be populated with the values stored at Wikidata by clicking on the "Update shared fields using values from Wikidata" link.
  • The "image" field is now shown by default.
  • Several cleanups to the underlying code.
  • Fix a bug where listing types were not handled in a case-insensitive way, prventing editing of templates using types such as "Do".

v2.0.x Changes

[edit]
  • Fix a bug where editing inline listings containing newlines was not working correctly.
  • Make VisualEditor work with listing editor - phab:T122454.
  • Fix bug where non-standard "type" attributes are deleted (example: "type=go").
  • Do not leave excess newlines when deleting a listing if there is a newline before and after the listing.
  • The listing edit summary should use the name of the section being edited, not the type of the listing being edited.
  • Fix a bug that prevented deletion of listings containing duplicate dollar signs ("$$").
  • Editing from a "diff" page will no longer reload the diff page when saving an edit, but will instead take the user to the page's canonical URL so that they can see their changes.
  • Fix bug where deletion failed when a listing was part of a definition list (example: *: {{listing}})

v2.0 Changes

[edit]
  • Update the listing editor dialog UI to provide more space for field entry, and to responsively collapse from two columns to one on small screens.
  • Use mw.Api().postWithToken instead of $.ajax to hopefully fix session token expiration issues.
  • Add support for editing of multi-paragraph listings.
  • Do not delete non-empty unrecognized listing template values (wikipedia, phoneextra, etc) when editing if the ALLOW_UNRECOGNIZED_PARAMETERS flag is set to true.
  • If listing editor form submit fails, re-display the listing editor form with the content entered by the user so that work is not lost.
  • Replace synchronous $.ajax call with asynchronous.
  • Allow edit summaries and marking edits as minor when editing listings.
  • Move 'add listing' link within the mw-editsection block.
  • Automatically replace newlines in listing content with <p> tags.
  • Fix bug where HTML comments inside listing fields prevented editing.
  • Provide configuration options so that some fields can be displayed only if they have non-empty values (examples: "fax" in the default configuration).
  • Add basic email address validation.
  • A failed captcha challenge no longer causes further captcha attempts to fail.
  • Significant code reorganization.

v1.4.0 Changes

[edit]
  • CAPTCHA dialog on addition of new external links for anon IPs
  • Shows edit buttons depending on protection level

v1.3.5 Changes

[edit]
  • Added ability to remove closed listings
  • Fix fourth-level heading glitch
  • Fix [add listing] to screen-only in CSS
  • Fixed label bug (input-type instead of form-type)
  • Warn about external link
  • Add breakpoints <br> in place of newlines in the content description

v1.3.3 Changes

[edit]
  • Slight adjustment for headings with special characters

v1.3.2 Changes

[edit]
  • Adjusted for other language headings and types

v1.3.1 Changes

[edit]
  • Corrected for single-line listings
  • Fixed single parameter bug

v1.3.0 Changes

[edit]
  • Added link to help page
  • Added geomap link for address/name
  • Fixed whitespace bug

v1.2.8 Changes

[edit]
  • Get uncached version

v1.2.6 Changes

[edit]
  • Converted to flat form
  • Added geomap link
  • Added currency buttons
  • Accounted for nested templates

v1.1.0 Changes

[edit]
  • Added [add listing] button

v1.0.0 Changes

[edit]
  • Initial release


Discover



Powered by GetYourGuide