Extension:MobileFrontend/Configuration: Difference between revisions
adding < translate > sections |
Marked this version for translation |
||
| Line 1: | Line 1: | ||
<languages/> |
<languages/> |
||
<translate> |
<translate> |
||
<!--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 |
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></>. |
<tvar|code2><code>require_once "$IP/extensions/MobileFrontend/MobileFrontend.php";</code></>. |
||
<!-- 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! --> |
||
<!--T:3--> |
|||
Note that for a simple site adding <code>$wgMFAutodetectMobileView = true;</code> might be all you need to make it Just Work™. |
Note that for a simple site adding <code>$wgMFAutodetectMobileView = true;</code> might be all you need to make it Just Work™. |
||
== Configuring mobile browser auto detection == |
== Configuring mobile browser auto detection == <!--T:4--> |
||
<!--T:5--> |
|||
See [[<tvar|auto>Special:MyLanguage/Extension:MobileFrontend/Configuring browser auto-detection</>|Configuring browser auto-detection]] |
See [[<tvar|auto>Special:MyLanguage/Extension:MobileFrontend/Configuring browser auto-detection</>|Configuring browser auto-detection]] |
||
==Configuring the main page==</translate> |
==Configuring the main page== <!--T:6--></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> |
<translate> |
||
=== Configuring a skin === |
=== Configuring a skin === <!--T:7--> |
||
<!--T:8--> |
|||
<del>At time of writing, MobileFrontend is packaged up with the Minerva skin.</del> |
<del>At time of writing, MobileFrontend is packaged up with the Minerva skin.</del> |
||
<!--T:9--> |
|||
You can override this by using the configuration flag <tvar|flag>'''$wgMFDefaultSkinClass'''</> |
You can override this by using the configuration flag <tvar|flag>'''$wgMFDefaultSkinClass'''</> |
||
<!--T:10--> |
|||
By default this is configured to:</translate> |
By default this is configured to:</translate> |
||
| Line 30: | Line 36: | ||
<translate> |
<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 |
||
<!--T:14--> |
|||
* Install [[<tvar|geo1>Special:MyLanguage/Extension:GeoData</>|GeoData]] |
* Install [[<tvar|geo1>Special:MyLanguage/Extension:GeoData</>|GeoData]] |
||
<!--T:15--> |
|||
* Run update.php |
* Run update.php |
||
<!--T:16--> |
|||
* In LocalSettings.php add $wgMFNearby = true; |
* In LocalSettings.php add $wgMFNearby = true; |
||
<!--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|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 |
||
<!--T:18--> |
|||
Alternatively you can use an alien MediaWiki instance for Nearby with the following 2 lines in your LocalSettings.</translate> <translate>The nearby endpoint will be used to find related content to a given location.</translate> |
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"> |
||
Revision as of 13:41, 19 March 2020
MobileFrontend supports various configuration options that you can define in LocalSettings.php after calling wfLoadExtension( 'MobileFrontend' ); or
require_once "$IP/extensions/MobileFrontend/MobileFrontend.php";.
Note that for a simple site adding $wgMFAutodetectMobileView = true; might be all you need to make it Just Work™.
Configuring mobile browser auto detection
See Configuring browser auto-detection
Configuring the main page
Configuring a skin
At time of writing, MobileFrontend is packaged up with the Minerva skin.
You can override this by using the configuration flag $wgMFDefaultSkinClass
By default this is configured to:
// $wgMFDefaultSkinClass = 'SkinVector'; // use Vector skin for your mobile site skin.
// $wgMFDefaultSkinClass = 'SkinTimeless'; // Use Timeless skin for your mobile site skin.
$wgMFDefaultSkinClass = 'SkinMinerva'; // Default - use Minerva as your mobile site skin.
Enable Nearby
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;