Extension:MobileFrontend

Installation

 * 1) Copy the files from the SVN repository to your server (see the "Download" links in the sidebox).
 * 2) Add this link to the bottom of LocalSettings.php:

Configuration settings
The following variables can be defined in LocalSettings.php after calling require_once("$IP/extensions/MobileFrontend/MobileFrontend.php"):

Homepage
By default, the only content that a user will see on their project homepage is search, license, and action control. In order to see content you have to use the appropriate css selectors. See http://meta.wikimedia.org/wiki/Mobile_Projects/Mobile_Gateway#Mobile_homepage

More information
If you would like to test the mobile extension on a desktop browser or your device doesn't render the mobile version you can append the following key-value pair to the querystring: useFormat=mobile e.g., http://nomad.tesla.usability.wikimedia.org/index.php/Eby_J._Jose?useformat=mobile

If you would like to see the wap version of the mobile extension use: ?useFormat=mobile-wap instead.

XHTML View



WML View



Legacy API
Currently, MobileFrontend has an ad-hoc API available through the main entry point. If you add a &format=json you will get back a document that has the following sections


 * title ~ Page title
 * html ~ HTML body

ex. http://en.wikipedia.org/wiki/Main_Page?useformat=mobile&format=json {   "title": "Main Page", "html":" Today's featured article<\/h2> \n <\/img><\/a> <\/div>\n Tom Driberg<\/a><\/b> (1905\u20131976) was a British journalist and politician who was a Labour Party<\/a> Member of Parliament<\/a> between 1942 and 1974. ....

New API
The new API currently under development extends action=parse with the following parameters:
 * mobileformat={html|wml}: Return rendered page in a mobile format, HTML for modern phones or WML for dumb phones.
 * expandablesections</tt>: Make sections in mobile output collapsed by default, expandable via JavaScript. Ignored if section</tt> parameter is set. Note that we may deprecate section collapsing in HTML completely in the future.
 * noimages</tt>: Disable images in mobile output.
 * mainpage</tt>: Apply mobile main page transformations.

Example:

api.php?action=parse&page=Main_Page&mobileformat=html&prop=text&format=json

 {	"parse": { "title": "Main Page", "text": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n<!DOCTYPE html PUBLIC \"-\/\/W3C\/\/DTD HTML 4.0 Transitional\/\/EN\" \"http:\/\/www.w3.org\/TR\/REC-html40\/loose.dtd\">\n<?xml encoding=\"UTF-8\"?>\n <div id=\"content\"> This is a <a href=\"http:\/\/www.mediawiki.org\/wiki\/Extension:GeoData\" class=\"extiw\" title=\"mediawikiwiki:Extension:GeoData\">GeoData<\/a> test wiki. . . . </tt>