Listings extension
From Tech
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:
-
nameName of the destination. -
altAdditional information on the destination. This string can contain Wiki markups. -
addressAddress the destination. This string can contain Wiki markups. -
directionsWay to or region of the destination. This string can contain Wiki markups. -
phonePhone number(s) of the destination. -
tollfreeToll-free phone number(s) of the destination. -
emailEmail of the destination. -
faxFax number(s) of the destination. -
urlURL of the destination. -
hoursOpening hours of the destination. -
pricePrice for the entrance or for accomodation of the destination. -
checkinCheck-in time of the hotels. -
checkoutCheck-out-time of the hotels. -
latPosition latitude of the destination. This information will be show only iflat,longattributes and thelistingsPositionTemplatestring are specified. -
longPosition longitude of the destination. This information will be show only iflat,longattributes and thelistingsPositionTemplatestring are specified. -
tagsAdditional 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
- National Underground Railroad Freedom Center (Museum), 50 East Freedom Way (Downtown), ☎ 333-7500 (toll-free: 1-877-648-4838), fax: 333-7500, email: info@freedomcenter.org. M-Sa 10AM-5PM, Su noon-6PM. Admission for one museum or OMNIMAX show: Adults $7.25, Seniors $6.25. Link to the Main Page.
[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}}.

