Extension:MobileFrontend/en

The MobileFrontend extension provides a mobile-friendly view. This page is designed for end users who want to install it on their development instance. If you are keen to help us build it and improve it we encourage you to get involved.

Prerequisites

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

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.

More information
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:

API
Example:

action=mobileview
Delivers content optimized for mobile devices for use by mobile apps and dynamic section views. Almost like a restricted-functionality action=parse, but more flexible and returns separate sections that are always obtained from full-page parse.

Parameters:
 * page: Title of page to process.
 * sections: Pipe-separated list of section numbers for which to return text or all for all sections.
 * redirect: Whether redirects should be followed, yes (default) or no. This parameter is intentionally made similar to the one to index.php.
 * prop</tt>: Which information to get:
 * text</tt>: HTML of selected section(s)
 * sections</tt>: Information about all sections on page
 * normalizedtitle</tt>: Normalized page title, will be returned only if it differs from the specified one.
 * sectionprop</tt>: What information about sections to get: pipe-separated list of value types defined by parser. It's the same as in action=parse: toclevel, level, line, number, index, fromtitle, anchor. "byteoffset" has been excluded as it makes no sense for this action.
 * noimages</tt>: Return HTML without images.
 * noheadings</tt>: Return HTML without headings.

Returned section information also includes the id</tt> for every section - its zero-based number; and for sections that contains references added by Cite, there's also references</tt> data member.

Examples:

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]

Using the mobile view
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.