Extension:Listings

From MediaWiki.org
Jump to navigation Jump to search
MediaWiki extensions manual
Crystal Clear action run.svg
Listings
Release status: beta
Implementation API
Description This extension was written for use in imported Wikitravel articles. In future, the tags used should be substituted by templates.
Author(s) Roland Unger
Latest version 1.03 (2012-08-30)
MediaWiki 1.20+
Database changes No
License GNU General Public License 2.0 or later
Download
Hooks used
ParserFirstCallInit
Translate the Listings extension if it is available at translatewiki.net
Check usage and version matrix.
Issues Open tasks · Report a bug

Installation[edit]

  • Download and place the file(s) in a directory called Listings in your extensions/ folder.
  • Add the following code at the bottom of your LocalSettings.php:
    wfLoadExtension( 'Listings' );
    
  • Yes Done – Navigate to Special:Version on your wiki to verify that the extension is successfully installed.

Usage[edit]

Tags[edit]

The Listings extension implements the following tags:

  • <buy>
  • <do>
  • <drink>
  • <eat>
  • <listing>
  • <see>
  • <sleep>

Attributes[edit]

All tags can be used with the same attributes:

  • name Name of the destination.
  • alt Additional information on the destination. This string can contain Wiki markups.
  • address Address the destination. This string can contain Wiki markups.
  • directions Way to or region of the destination. This string can contain Wiki markups.
  • phone Phone number(s) of the destination.
  • tollfree Toll-free phone number(s) of the destination.
  • email Email of the destination.
  • fax Fax number(s) of the destination.
  • url URL of the destination.
  • hours Opening hours of the destination.
  • price Price for the entrance or for accomodation of the destination.
  • checkin Check-in time of the hotels.
  • checkout Check-out-time of the hotels.
  • lat Position latitude of the destination. This information will be show only if lat, long attributes and the listingsPositionTemplate string are specified.
  • long Position longitude of the destination. This information will be show only if lat, long attributes and the listingsPositionTemplate string are specified.
  • tags Additional tags (specifications) of the destination. This information is not shown.

Text[edit]

The text included by the starting and closing tags is shown at the end. This string can contain Wiki markups.

Example[edit]

* <see name="National Underground Railroad Freedom Center" alt="Museum" address="50 East Freedom Way" directions="Downtown" phone="333-7500" tollfree="1-877-648-4838" email="info@freedomcenter.org" fax="333-7500" lat="30.1234" long="50.5678" url="http://www.freedomcenter.org" hours="M-Sa 10AM-5PM, Su noon-6PM" price="Admission for one museum or OMNIMAX show: Adults $7.25, Seniors $6.25">Link to the [[Main Page]].</see>

Deprecation[edit]

This extension performs a task which is already possible using standard templates. This appears to have been intended as a means to retain compatibility with an old Wikitravel listings editor which is not in use on Wikivoyage. The default behaviour effectively hard-codes a template-like design and field names into the extension's PHP code; this must be overridden if new fields are to be added without changing the code.

  • bugzilla:43220 implemented a patch which overrides the generated output for this extension by redirecting processing to a template.
  • Individual-language Wikivoyage projects have deployed robot scripts to edit every page, replacing the XML tags with voy:template:listing or its local equivalent.
  • As of Oct 2018, phab:T206102 proposes the removal of the extension from Wikivoyage, the only major wiki family using this code.

The tags still work on Wikivoyage, but are deprecated and (at least on en:) any pages still using the tag are being added to a maintenance category.