Jump to content

Extension:MobileFrontend/Configuration: Difference between revisions

From mediawiki.org
Content deleted Content added
wrong markup :(
(top): Remove mention of MobileFrontend.php - all supported versions use extension registration
 
(15 intermediate revisions by 6 users not shown)
Line 2: Line 2:
<translate>
<translate>
<!--T:2-->
<!--T:2-->
MobileFrontend supports [<tvar|url>https://phabricator.wikimedia.org/diffusion/EMFR/browse/master/README.md;2d7a1ce4a027714bf1a7f82a3c0e9abfcc98910e$87</> various configuration options] that you can define in LocalSettings.php after calling <tvar|code1><code>wfLoadExtension( 'MobileFrontend' );</code></> or <tvar|code2><code>require_once "$IP/extensions/MobileFrontend/MobileFrontend.php";</code></>.
MobileFrontend supports [[<tvar name=1>phab:diffusion/EMFR/browse/master/README.md;2d7a1ce4a027714bf1a7f82a3c0e9abfcc98910e$87</tvar>|various configuration options]] that you can define in LocalSettings.php after calling <tvar name=code1><code>wfLoadExtension( 'MobileFrontend' );</code></tvar>.</translate>
<!-- when translating into another language - please review the existing configuration options and copy into the translated version! thank you! -->
<!-- when translating into another language - please review the existing configuration options and copy into the translated version! thank you! -->


<translate>
<!--T:3-->
<!--T:3-->
Note that for a simple site adding <tvar|1><code>$wgMFAutodetectMobileView = true;</code></> might be all you need to make it Just Work™.
Note that for a simple site adding <tvar name=1><syntaxhighlight lang=php inline>$wgMFAutodetectMobileView = true;</syntaxhighlight></tvar> might be all you need to make it Just Work™.

== All configuration options == <!--T:20-->

<!--T:21-->
All configuration options are detailed in the [<tvar name=url>https://github.com/wikimedia/mediawiki-extensions-MobileFrontend#configuration-options</tvar> README.md file]


== Configuring mobile browser auto detection == <!--T:4-->
== Configuring mobile browser auto detection == <!--T:4-->


<!--T:5-->
<!--T:5-->
See [[<tvar|auto>Special:MyLanguage/Extension:MobileFrontend/Configuring browser auto-detection</>|Configuring browser auto-detection]]
See [[<tvar name=auto>Special:MyLanguage/Extension:MobileFrontend/Configuring browser auto-detection</tvar>|Configuring browser auto-detection]]


==Configuring the main page== <!--T:6-->
==Configuring the main page== <!--T:6-->
Line 19: Line 25:
<translate>
<translate>
=== Configuring a skin === <!--T:7-->
=== Configuring a skin === <!--T:7-->

<!--T:8-->
<del>At time of writing, MobileFrontend is packaged up with the Minerva skin.</del>


<!--T:9-->
<!--T:9-->
You can override this by using the configuration flag  <tvar|flag>'''$wgMFDefaultSkinClass'''</>
You can override this by using the configuration flag  <tvar name=flag>'''$wgDefaultMobileSkin'''</tvar>


<!--T:10-->
<!--T:10-->
Line 31: Line 34:


<syntaxhighlight lang="php">
<syntaxhighlight lang="php">
// $wgMFDefaultSkinClass = 'SkinVector'; // use Vector skin for your mobile site skin.
// $wgDefaultMobileSkin = 'vector'; // <translate nowrap><!--T:22--> use Vector skin for your mobile site skin.</translate>
// $wgMFDefaultSkinClass = 'SkinTimeless'; // Use Timeless skin for your mobile site skin.
// $wgDefaultMobileSkin = 'timeless'; // <translate nowrap><!--T:23--> Use Timeless skin for your mobile site skin.</translate>
$wgMFDefaultSkinClass = 'SkinMinerva'; // Default - use Minerva as your mobile site skin.
$wgDefaultMobileSkin = 'minerva'; // <translate nowrap><!--T:24--> Default - use Minerva as your mobile site skin.</translate>
</syntaxhighlight>
</syntaxhighlight>


Line 46: Line 49:
<translate>
<translate>
<!--T:14-->
<!--T:14-->
* Install [[<tvar|geo1>Special:MyLanguage/Extension:GeoData</>|GeoData]]</translate>
* Install [[<tvar name=geo1>Special:MyLanguage/Extension:GeoData</tvar>|GeoData]]</translate>
<translate>
<translate>
<!--T:15-->
<!--T:15-->
* Run <tvar|1>update.php</></translate>
* Run <tvar name=1>update.php</tvar></translate>
<translate>
<translate>
<!--T:16-->
<!--T:16-->
* In <tvar|1>LocalSettings.php</> add <tvar|2><code>$wgMFNearby = true;</code></></translate>
* In <tvar name=1>LocalSettings.php</tvar> add <tvar name=2><syntaxhighlight lang=php inline>$wgMFNearby = true;</syntaxhighlight></tvar></translate>
<translate>
<translate>
<!--T:17-->
<!--T:17-->
* Add data to your articles to one or more pages <tvar|coord><code><nowiki>{{#coordinates:37.786971|-122.399677|primary}}</nowiki></code></> see the documentation for [[<tvar|geo2>Special:MyLanguage/Extension:GeoData</>|GeoData]] for syntax details
* Add data to your articles to one or more pages <tvar name=coord><code><nowiki>{{#coordinates:37.786971|-122.399677|primary}}</nowiki></code></tvar> see the documentation for [[<tvar name=geo2>Special:MyLanguage/Extension:GeoData</tvar>|GeoData]] for syntax details

<!--T:18-->
Alternatively you can use an alien MediaWiki instance for Nearby with the following 2 lines in your LocalSettings.</translate> <translate><!--T:19--> The nearby endpoint will be used to find related content to a given location.
</translate>
</translate>

<translate><!--T:18--> Alternatively you can use an alien MediaWiki instance for Nearby with the following 2 lines in your LocalSettings.</translate>
<translate><!--T:19--> The nearby endpoint will be used to find related content to a given location.</translate>


<syntaxhighlight lang="php">
<syntaxhighlight lang="php">

Latest revision as of 19:12, 19 August 2026

MobileFrontend supports various configuration options that you can define in LocalSettings.php after calling wfLoadExtension( 'MobileFrontend' );.

Note that for a simple site adding $wgMFAutodetectMobileView = true; might be all you need to make it Just Work™.

All configuration options

[edit | edit source]

All configuration options are detailed in the README.md file

Configuring mobile browser auto detection

[edit | edit source]

See Configuring browser auto-detection

Configuring the main page

[edit | edit source]

Configuring a skin

[edit | edit source]

You can override this by using the configuration flag  $wgDefaultMobileSkin

By default this is configured to:

// $wgDefaultMobileSkin = 'vector'; // use Vector skin for your mobile site skin.
// $wgDefaultMobileSkin = 'timeless'; // Use Timeless skin for your mobile site skin.
$wgDefaultMobileSkin = 'minerva'; // Default - use Minerva as your mobile site skin.

Enable Nearby

[edit | edit source]

MobileFrontend provides the Special:Nearby page with a little configuration. To get this to work a few optional steps are required:

  • Due to browser security you will need to be running a secure site over SSL: it is not possible to request a users location over HTTP
  • Install GeoData
  • Run update.php
  • In LocalSettings.php add $wgMFNearby = true;
  • Add data to your articles to one or more pages {{#coordinates:37.786971|-122.399677|primary}} see the documentation for GeoData for syntax details

Alternatively you can use an alien MediaWiki instance for Nearby with the following 2 lines in your LocalSettings. The nearby endpoint will be used to find related content to a given location.

$wgMFNearbyEndpoint = 'http://en.m.wikipedia.org/w/api.php';
$wgMFNearby = true;