Listings extension

From Tech

Jump to: navigation, search

This extension was written for use in imported Wikitravel articles. In future, the tags used should be substituted by more powerful ones.

Contents

[edit] License

GPL.

[edit] Usage

[edit] Tags

The Listings extension implements the following tags:

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

[edit] Attributes

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.

[edit] Text

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

[edit] Example

* <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>

will produce

[edit] Installing Listings

Donwload from svn:mediawiki/trunk/extensions/Listings. Copy Listings.php and Listings.i18n.css into the Listings folder in the extensions folder of your MediaWiki installation. Then add the following line to your LocalSettings.php file (near the end):

 require_once( "$IP/extensions/Listings/Listings.php" );

[edit] Used messages

Message strings — noted in Listings.i18n.php — are available now for three languages (de, en, and it).

<?php
/**
 * Internationalisation file for Listings extension.
 *
 * @package MediaWiki
 * @subpackage Extensions
*/
 
$wgListingsMessages = array();
 
$wgListingsMessages['en'] = array(
	'listingsUnknown'           => 'Unknown destination',
	'listingsPhone'             => 'phone',
	'listingsFax'               => 'fax',
	'listingsEmail'             => 'email',
	'listingsTollfree'          => 'toll-free',
	'listingsCheckin'           => 'Check-in',
	'listingsCheckout'          => 'check-out',
	'listingsPosition'          => 'position',
	'listingsPositionTemplate'  => '',
);
 
$wgListingsMessages['de'] = array(
	'listingsUnknown'           => 'Unbekannte Einrichtung',
	'listingsPhone'             => 'Tel.',
	'listingsFax'               => 'Fax',
	'listingsEmail'             => 'Email',
	'listingsTollfree'          => 'gebührenfrei',
	'listingsCheckin'           => 'Checkin',
	'listingsCheckout'          => 'Checkout',
	'listingsPosition'          => 'Lage',
	'listingsPositionTemplate'  => '',
);
 
$wgListingsMessages['fr'] = array(
	'listingsUnknown'           => 'Destination inconnue',
	'listingsPhone'             => 'tél.',
	'listingsFax'               => 'fax',
	'listingsEmail'             => 'email',
	'listingsTollfree'          => 'gratuit',
	'listingsCheckin'           => 'Inscriptions',
	'listingsCheckout'          => 'contrôle',
	'listingsPosition'          => 'situation',
	'listingsPositionTemplate'  => '',
);
 
$wgListingsMessages['it'] = array(
	'listingsUnknown'           => 'Destinazione sconosciuta',
	'listingsPhone'             => 'tel.',
	'listingsFax'               => 'fax',
	'listingsEmail'             => 'email',
	'listingsTollfree'          => 'gratis',
	'listingsCheckin'           => 'Check-in',
	'listingsCheckout'          => 'check-out',
	'listingsPosition'          => 'posizione',
	'listingsPositionTemplate'  => '',
);
 
?>

listingsPositionTemplate contains a template call without "{" and "}" parentheses and with placeholders $1 (latitude) and $2 (longitude). If this string is missing, no position is shown.

  • example: Coord|$1|$2 instead of {{Coord-de-DD|$1|$2}}.

[edit] Known Problems

Personal tools
Participation