Extension:MobileFrontend/Configuration: Difference between revisions
mNo edit summary |
→(top): Remove mention of MobileFrontend.php - all supported versions use extension registration |
||
| (20 intermediate revisions by 8 users not shown) | |||
| Line 1: | Line 1: | ||
<languages/> |
<languages/> |
||
<translate> |
|||
<!--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>.</translate> |
||
| ⚫ | |||
<translate> |
|||
| ⚫ | |||
<!--T:3--> |
|||
| ⚫ | |||
| ⚫ | |||
== All configuration options == <!--T:20--> |
|||
| ⚫ | |||
<!--T:21--> |
|||
== Configuring mobile browser auto detection == |
|||
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--> |
|||
<!--T:5--> |
|||
| ⚫ | |||
See [[<tvar name=auto>Special:MyLanguage/Extension:MobileFrontend/Configuring browser auto-detection</tvar>|Configuring browser auto-detection]] |
|||
| ⚫ | |||
</translate> |
|||
{{Main|Mobile Gateway/Mobile homepage formatting|l1=<translate><!--T:1--> Mobile main page formatting</translate>}} |
{{Main|Mobile Gateway/Mobile homepage formatting|l1=<translate><!--T:1--> Mobile main page formatting</translate>}} |
||
<translate> |
|||
=== Configuring a skin === |
=== Configuring a skin === <!--T:7--> |
||
<!--T:9--> |
|||
<del>At time of writing, MobileFrontend is packaged up with the Minerva skin.</del> |
|||
| ⚫ | |||
| ⚫ | |||
<!--T:10--> |
|||
By default this is configured to: |
By default this is configured to: |
||
</translate> |
|||
<syntaxhighlight lang="php"> |
<syntaxhighlight lang="php"> |
||
// $ |
// $wgDefaultMobileSkin = 'vector'; // <translate nowrap><!--T:22--> use Vector skin for your mobile site skin.</translate> |
||
// $ |
// $wgDefaultMobileSkin = 'timeless'; // <translate nowrap><!--T:23--> Use Timeless skin for your mobile site skin.</translate> |
||
$ |
$wgDefaultMobileSkin = 'minerva'; // <translate nowrap><!--T:24--> Default - use Minerva as your mobile site skin.</translate> |
||
</syntaxhighlight> |
</syntaxhighlight> |
||
<translate> |
|||
==Enable Nearby== |
==Enable Nearby== <!--T:11--> |
||
<!--T:12--> |
|||
MobileFrontend provides the Special:Nearby page with a little configuration. To get this to work a few optional steps are required: |
MobileFrontend provides the Special:Nearby page with a little configuration. To get this to work a few optional steps are required: |
||
<!--T:13--> |
|||
* 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 |
* 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</translate> |
||
* Install [[Special:MyLanguage/Extension:GeoData|GeoData]] |
|||
<translate> |
|||
* Run update.php |
|||
<!--T:14--> |
|||
* In LocalSettings.php add $wgMFNearby = true; |
|||
* |
* Install [[<tvar name=geo1>Special:MyLanguage/Extension:GeoData</tvar>|GeoData]]</translate> |
||
<translate> |
|||
| ⚫ | |||
<!--T:15--> |
|||
* Run <tvar name=1>update.php</tvar></translate> |
|||
<translate> |
|||
<!--T:16--> |
|||
* In <tvar name=1>LocalSettings.php</tvar> add <tvar name=2><syntaxhighlight lang=php inline>$wgMFNearby = true;</syntaxhighlight></tvar></translate> |
|||
<translate> |
|||
<!--T:17--> |
|||
* 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 |
|||
</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"> |
||
| Line 42: | Line 68: | ||
$wgMFNearby = true; |
$wgMFNearby = true; |
||
</syntaxhighlight> |
</syntaxhighlight> |
||
[[Category:MobileFrontend{{#translation:}}]] |
|||
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;