Extension:MobileFrontend

MobileFrontend is a MediaWiki extension providing a mobile front-end to MediaWiki sites.

Installation

 * 1) Copy the files from the git 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"):

Configuring mobile browser auto detection
See Configuring Browser Auto-Detection

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., https://en.wikipedia.org/wiki/Chuck_Schuldiner?useformat=mobile

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





If you would like to view a page in the beta without enabling it across the entire site you can append to the query string of any page

Extended action=parse
action=parse receives the following extra parameters:
 * mobileformat={html|wml}: Return rendered page in a mobile format, HTML for modern phones or WML for dumb phones.
 * noimages: Disable images in mobile output.
 * mainpage: Apply mobile main page transformations.

Example:

[//en.wikipedia.org/w/api.php?action=parse&page=Therion_(band)&mobileformat=html&prop=text&format=jsonfm api.php?action=parse&page=Therion_(band)&mobileformat=html&prop=text&format=json]

 {	"parse": { "title": "Therion (band)", "text": "\n

Same request for XML: [//www.mediawiki.org/w/api.php?action=mobileview&page=Extension:MobileFrontend/Example&sections=0&prop=text|sections&format=xmlfm api.php?action=mobileview&page=Extension:MobileFrontend/Example&sections=0&prop=text|sections&format=xml]

prop=extracts
Returns article extracts. Two formats are available: cleaned up HTML and plain text.

Parameters:
 * exchars</tt>: Length of extracts in characters.
 * exsentences</tt>: Number of sentences to return.
 * exintro</tt>: Return only zeroth section.
 * exsectionformat</tt>: What section heading format to use for plaintext extracts:
 * wiki</tt> — e.g., == Wikitext ==
 * plain</tt> — no special decoration
 * raw</tt> — this extension's internal representation: <ASCII 1><ASCII 2> <ASCII 2><ASCII 1>.


 * exlimit</tt>: Maximum number of extracts to return. Because excerpts generation can be slow, the limit is capped at 20 for intro-only extracts and 1 for whole-page extracts.
 * explaintext</tt>: Return plain-text extracts.
 * excontinue</tt>: When more results are available, use this parameter to continue.

Example:

[//en.wikipedia.org/w/api.php?action=query&prop=extracts&exchars=100&titles=Earth&format=jsonfm api.php?action=query&prop=extracts&exchars=100&titles=Earth&format=json]

WMF properties
On Wikimedia Foundation run properties, we use Varnish caching servers to check the user agent of your device. If your user agent appears to be coming from a mobile device, the Varnish servers will set an appropriate 'X-Device' header for your request, and you will be redirected to the MobileFrontend version of an article. Alternatively, you can click 'Mobile view' in the footer of an article or append "useformat=mobile" to the query string to view an article in the mobile view.

Example:

Varnish server vcl config for X-Device

If you are viewing the mobile version of article but wish to see the desktop-version of that article, you can click 'View this article on regular <SITENAME>' to switch back.

If you want to permanently disable the mobile view for your web browser, you can click 'Permanently disable mobile site', which will set a cookie instructing the WMF servers to always display the desktop version of the site.

Non-WMF properties
For non-WMF properties, you can either set up your configuration to mimic how things are done at the WMF (doing device detection at the proxy layer and setting specific X-Device headers), or you can simply use "?useformat=mobile" to switch an article to use the mobile view.

Beta/Alpha Opt-in
To see additional features of the mobile site that are not 100% production ready, you can opt in to the beta or alpha ('here be dragons') modes of the site. If you opt in, be aware that there is a higher likelihood of experiencing bugs or other weird issues than when you use the stable version of the site. Features in the beta version of the site are generally more stable and polished than those in the alpha. So, consider yourself warned!

To opt in, tap on the hamburger icon next to the search bar to open the navigation menu. Tap 'Settings'. Then, tap the toggle next to 'Beta' from 'off' to 'on'. Note that you can only enter the alpha if you're already opted into the beta.

WMF cluster deployments
See Extension:MobileFrontend/Deployments for deployment information on past and upcoming deployments of MobileFrontend to the WMF cluster.