Jump to content

Extension:MobileFrontend/Configuration: Difference between revisions

From mediawiki.org
Content deleted Content added
$wgMFDefaultSkinClass doesn't work in 1.39
(top): Remove mention of MobileFrontend.php - all supported versions use extension registration
 
(5 intermediate revisions by 3 users not shown)
Line 2: Line 2:
<translate>
<translate>
<!--T:2-->
<!--T:2-->
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> or <tvar name=code2><code>require_once "$IP/extensions/MobileFrontend/MobileFrontend.php";</code></tvar>.
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 name=1><syntaxhighlight lang=php inline>$wgMFAutodetectMobileView = true;</syntaxhighlight></tvar> 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™.
</translate>


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


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


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


Line 25: Line 25:
<translate>
<translate>
=== Configuring a skin === <!--T:7-->
=== Configuring a skin === <!--T:7-->
</translate>
<del><translate><!--T:8--> At time of writing, MobileFrontend is packaged up with the Minerva skin.</translate></del>


<translate>
<!--T:9-->
<!--T:9-->
You can override this by using the configuration flag  <tvar name=flag>'''$wgDefaultMobileSkin'''</tvar>
You can override this by using the configuration flag  <tvar name=flag>'''$wgDefaultMobileSkin'''</tvar>
Line 37: Line 34:


<syntaxhighlight lang="php">
<syntaxhighlight lang="php">
// $wgDefaultMobileSkin = 'vector'; // use Vector skin for your mobile site skin.
// $wgDefaultMobileSkin = 'vector'; // <translate nowrap><!--T:22--> use Vector skin for your mobile site skin.</translate>
// $wgDefaultMobileSkin = 'timeless'; // Use Timeless skin for your mobile site skin.
// $wgDefaultMobileSkin = 'timeless'; // <translate nowrap><!--T:23--> Use Timeless skin for your mobile site skin.</translate>
$wgDefaultMobileSkin = 'minerva'; // 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>


<translate>
<translate>

==Enable Nearby== <!--T:11-->
==Enable Nearby== <!--T:11-->



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;