Extension:MobileFrontend

The MobileFrontend extension provides a mobile-friendly view.

Prerequisites

 * Although MediaWiki doesn't require it, PHP must have mbstring support for this extension to work.
 * The newest version of MobileFrontend requires the extension Mantle.

Configuration settings
The following variables can be defined in LocalSettings.php after calling. Note that for a simple site adding  might be all you need to make it Just Work™.

Configuring mobile browser auto detection
See /Configuring browser auto-detection

Configuring the main page
By default, the Main Page on the mobile site is the same page as on desktop. To show an optimized version of your Main page to your mobile users you can disable the desktop Main page simply by following these two rules to add mobile specific content: For example:
 * A selector that is prefixed with mf- will be added to the mobile main page for any project. Any title attributes set on these elements will be promoted into a heading before the section. A title attribute is optional.
 * Any element with the class 'nomobile' will not show on mobile.

Hello

would create a section named Wikimedia Blog with the text 'Hello'.

After you saved your Main page, on mobile devices you will see only the sections you added following these rules.

Additional tweaks
Get the most out of MobileFrontend by adding these other optional dependencies:
 * Extension:Geodata - get Special:Nearby and geotag your articles
 * Extension:PageImages - adds images to search and nearby results
 * Extension:VisualEditor - add Visual editing to your mobile experience.

Quick how to
Add at the top of the wikitext and add at the bottom. Refresh the mobile site. Now you can either adjust your styling to be mobile friendly or you can hide parts of the homepage by adding class="nomobile" to the elements you do not want to show.

A more complete set of instructions can be found here.

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 query string: 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

If you would like to force your wiki to always display in mobile view, add the following to your LocalSettings.php:

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
Migrated to TextExtracts

action=wikigrokresponse
Provided by a seperate Extension WikiGrok Logs each claim in a WikiGrok response with the MobileWebWikiGrok schema.

WMF sites
On Wikimedia Foundation-run sites, 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 ' 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 sites
For non-WMF sites, 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.