Page MenuHomeMiraheze

MobileDetect skin
Closed, InvalidPublic

Description

Hello

Using the MobileDetect extension, I'd like to specify the "Minerva" skin as the default mobile skin on (https://www.mediawiki.org/wiki/Extension:MobileDetect#wfMobileDetect()_function).

I know that the MobileFrontend extension is available, but the Mobile.css page doesn't work. If I use MobileDetect, I think I could change the CSS of my mobile skin directly from Minerva.css, which works.

Link of my wiki: https://tintinpedia.miraheze.org/

Thanks in advance,
Soronos

Event Timeline

Soronos triaged this task as Normal priority.Sep 21 2023, 14:04
Soronos created this task.

This extension is enabled by default on all Miraheze wikis.

Soronos reopened this task as Open.EditedSep 22 2023, 10:22

I didn't ask to activate the extension, but to activate parameters of this extension that I can't modify myself.

The extension is enabled by default, but is currently only used for <mobileonly> tags. There's another part of the extension (see link in my request) that detects whether the user viewing the wiki is on mobile or desktop, and changes the skin accordingly. So I'd like to activate this to have Vector as a desktop skin, and Minerva as a mobile skin.

To be more clear, this would be the equivalent of adding this to my LocalSettings.php :

wfLoadExtension( 'MobileDetect' );
$mobile = wfMobileDetect();
if ( $mobile ) {
    $wgDefaultSkin = "minerva"; 
} else {
    $wgDefaultSkin = "vector";  
}

I don't think it's possible to do:

$mobile = wfMobileDetect();
if ( $mobile ) {
    $wgDefaultSkin = "chick"; # If mobile
} else {
    $wgDefaultSkin = "vector"; # If not mobile
}

because we have wgDefaultSkin in ManageWiki and we cannot override it. Neitherless MobileFrontend should be what you want (uses minerva if it detects mobile otherwise uses what you set as wgDefaultSkin).

Redmin removed Redmin as the assignee of this task.Sep 26 2023, 18:05
Unknown Object (User) closed this task as Invalid.Sep 26 2023, 18:08

With MobileFrontend enabled, you can enable any skin as the default mobile skin, just go to the "Styling" tab of ManageWiki and change $wgDefaultMobileSkin.