Extension talk:MobileFrontend

Jump to navigation Jump to search

About this board

If you have a feature request just request it here you'll get a much quicker reply :-) We are also around in #wikimedia-mobile if you want a quicker answer!

If you are trying to replicate behaviour you see on Wikimedia sites, please be sure to read through the configuration options before asking a question here.

High server load with MobileFrontend

1
TVCL (talkcontribs)

After installing MobileFrontend, there was a significant increase in entry processes and considerably higher CPU usage. Has anyone else experienced this? Thanks.

Reply to "High server load with MobileFrontend"

GlobalVarConfig::get: undefined option: 'ResourceLoaderLESSVars'

9
Jamiehutber (talkcontribs)

I am getting the below error with 3.33 and trying to use Mobile Frontend with the following setup:

wfLoadExtension( 'MobileFrontend' );

$wgMFAutodetectMobileView = true;

$wgMFDefaultSkinClass = 'SkinVector'; // use Vector skin


MediaWiki internal error.

Original exception: [e21caa824241ba159b043d0d] /Main_Page ConfigException from line 53 of /var/www/gwart.co.uk/mediawiki/includes/config/GlobalVarConfig.php: GlobalVarConfig::get: undefined option: 'ResourceLoaderLESSVars'

Backtrace:

#0 /var/www/gwart.co.uk/mediawiki/extensions/MobileFrontend/includes/MobileFrontend.hooks.php(707): GlobalVarConfig->get(string)

#1 /var/www/gwart.co.uk/mediawiki/includes/Hooks.php(174): MobileFrontendHooks::onBeforePageDisplay(OutputPage, SkinVector)

#2 /var/www/gwart.co.uk/mediawiki/includes/Hooks.php(234): Hooks::callHook(string, array, array, NULL, string)

#3 /var/www/gwart.co.uk/mediawiki/includes/OutputPage.php(2711): Hooks::runWithoutAbort(string, array)

#4 /var/www/gwart.co.uk/mediawiki/includes/MediaWiki.php(869): OutputPage->output(boolean)

#5 /var/www/gwart.co.uk/mediawiki/includes/MediaWiki.php(881): MediaWiki->{closure}()

#6 /var/www/gwart.co.uk/mediawiki/includes/MediaWiki.php(517): MediaWiki->main()

#7 /var/www/gwart.co.uk/mediawiki/index.php(42): MediaWiki->run()

#8 {main}

Exception caught inside exception handler: [e21caa824241ba159b043d0d] /Main_Page ConfigException from line 53 of /var/www/gwart.co.uk/mediawiki/includes/config/GlobalVarConfig.php: GlobalVarConfig::get: undefined option: 'ResourceLoaderLESSVars'

Backtrace:

#0 /var/www/gwart.co.uk/mediawiki/extensions/MobileFrontend/includes/MobileFrontend.hooks.php(707): GlobalVarConfig->get(string)

#1 /var/www/gwart.co.uk/mediawiki/includes/Hooks.php(174): MobileFrontendHooks::onBeforePageDisplay(OutputPage, SkinVector)

#2 /var/www/gwart.co.uk/mediawiki/includes/Hooks.php(234): Hooks::callHook(string, array, array, NULL, string)

#3 /var/www/gwart.co.uk/mediawiki/includes/OutputPage.php(2711): Hooks::runWithoutAbort(string, array)

#4 /var/www/gwart.co.uk/mediawiki/includes/exception/MWExceptionRenderer.php(136): OutputPage->output()

#5 /var/www/gwart.co.uk/mediawiki/includes/exception/MWExceptionRenderer.php(53): MWExceptionRenderer::reportHTML(ConfigException)

#6 /var/www/gwart.co.uk/mediawiki/includes/exception/MWExceptionHandler.php(98): MWExceptionRenderer::output(ConfigException, integer)

#7 /var/www/gwart.co.uk/mediawiki/includes/exception/MWExceptionHandler.php(172): MWExceptionHandler::report(ConfigException)

#8 /var/www/gwart.co.uk/mediawiki/includes/MediaWiki.php(544): MWExceptionHandler::handleException(ConfigException)

#9 /var/www/gwart.co.uk/mediawiki/index.php(42): MediaWiki->run()

#10 {main}

Malyacko (talkcontribs)

"3.33" of what exactly?

Reedy (talkcontribs)

What is version 3.33?

Does your version of MobileFrontend match the MW version?

Jamiehutber (talkcontribs)

Sorry guys, my mistake. 3.33 of mediawiki. Interesting point about MFE match MW version. I will check that now.

Malyacko (talkcontribs)

3.33 of mediawiki does not exist. See Download

Jamiehutber (talkcontribs)

`<meta name="generator" content="MediaWiki 1.33.0-alpha"/>` I checked out the repo which contained 3.33 inside there as an alpha.

But your suggestion worked a treat, as mobileFrontend also had an version 3.33. Though I think this is buggy, being as it is also alpha.

I consider this fixed as far as the error goes.

Thanks you

Malyacko (talkcontribs)

Again: There is no 3.33. 1.33 is not 3.33.

Jamiehutber (talkcontribs)
Jamiehutber (talkcontribs)

It appears I am running version 2.1.0 of MFE:


```

"name": "MobileFrontend",

"version": "2.1.0",

```

undefined option: 'ResourceLoaderLESSVars'

2
Sakshale (talkcontribs)

Upgrade, using Softaculous, from 1.31.0 to 1.32.0.


The Site died with following error. "undefined option: 'ResourceLoaderLESSVars'"


Added "$wgResourceLoaderLESSVars = false;" to the end of LocalSettings.php and error disappeared.


@Sakshale

Reedy (talkcontribs)

You should upgrade extensions when you upgrade core. It sounds like you're running MobileFrontend older than your MW Core version

Why is this extension not in core?

1
182.232.0.157 (talkcontribs)

From my experience, it is definitely expected in 2019 from anyone who develops a CMS that people use from smartphone, to be responsive.

As I understand MobileFrontend allows responsivness, I believe it should be included in core.

Reply to "Why is this extension not in core?"

Why "display: table" for hx, etc.?

1
Kghbln (talkcontribs)

On this wiki the headings go berserk in mobile view because of:

.content .mw-parser-output > h1,
.content .mw-parser-output > h2,
.content .mw-parser-output > h3,
.content .mw-parser-output > h4,
.content .mw-parser-output > h5,
.content .section-heading,
.content .in-block {
    display: table;
}

I am not sure where this comes from? Should this be reported and is there a way to prevent this from happening?

Reply to "Why "display: table" for hx, etc.?"

MODIFY THE MAIN MENU

5
Summary by Jdlrobson

This explains how you can circumvent the lack of main menu customisation in MobileFrontend/Minerva skin.

Jackqbox (talkcontribs)
For anyone interested in an personal change of the menu 
edit includes/skins/SkinMinerva.php
  • find
protected function getDiscoveryTools()
  • find the line
// Nearby link (if supported)
  • add above this line
		$menu->insert( 'Upload' )
			->addComponent(
				$this->msg( 'mobile-frontend-upload-button' )->escaped(),
				SpecialPage::getTitleFor( 'Upload',
					MWNamespace::getCanonicalName( $config->get( 'MFContentNamespace' ) ) )->getLocalUrl() .
						'#/test',
				MobileUI::iconClass( 'mf-upload-invert', 'before' ),
				[
					'id' => 'uploadButton',
					'data-event-name' => 'upload',
				]
			);
			
		$menu->insert( 'ListImages' )
			->addComponent(
				$this->msg( 'mobile-frontend-listimages-button' )->escaped(),
				SpecialPage::getTitleFor( 'ListFiles',
					MWNamespace::getCanonicalName( $config->get( 'MFContentNamespace' ) ) )->getLocalUrl() .
						'#/test',
				MobileUI::iconClass( 'mf-listimages-invert', 'before' ),
				[
					'id' => 'listimagesButton',
					'data-event-name' => 'ListImages',
				]
			);


edit i18n/en.json
  • find the line
"mobile-frontend-random-button": "Random",
  • add below
	
"mobile-frontend-upload-button": "Upload",
		
"mobile-frontend-listimages-button": "List Images",
edit extension.json
  • find the line "mobile.mainMenu.icons": {
  • find section

"images": { "anonymous": "resources/mobile.mainMenu.icons/anonymous.svg",

  • add below this line
				
"upload": "resources/mobile.mainMenu.icons/upload.svg",
"listimages": "resources/mobile.mainMenu.icons/listimages.svg",


allocate the folder resources/mobile.mainMenu.icons
  • add in resources/mobile.mainMenu.icons the required 2 new svg files with the desired icon
  • upload.svg
  • listimages.svg

i have tested this modification at twh4u.ddns.net

Nicolas NALLET (talkcontribs)

Hi, With which versions of MediaWiki and MobileFrontend have you tested ?

Thanks

Jackqbox (talkcontribs)

MediaWiki 1.28.0 PHP 5.5.38 (fpm-fcgi) MariaDB 5.5.51-MariaDB

also in older versions ,but i don't have any reference of them anymore. i am focussing right now on 1.28.x There are more easy and fancy menu changes possible like selectable menu items etc , but until now i don't need them. You can see the concept idea of them in an pubic dutch news side NOS . com

-- press pagina's wijzigen --

Aloist (talkcontribs)

Does this work also on Mediawiki 1.31?

Silkwood (talkcontribs)

With MobileFrontend 2.1.0 and MW 1.32 insert:

$menu->insert( 'Upload' )

                        ->addComponent(

                                $this->msg( 'mobile-frontend-upload-button' )->escaped(),

                                SpecialPage::getTitleFor( 'Upload')->getLocalUrl() .'#/upload',

                                MobileUI::iconClass( 'mf-upload-invert', 'before' ),

                                [

                                        'id' => 'uploadButton',

                                        'data-event-name' => 'upload',

                                ]

                        );     

instead.

Reply to "MODIFY THE MAIN MENU"

Why's this extension not part of core extensions?

1
182.232.39.241 (talkcontribs)

I humbly think it should be... ~~~~

Reply to "Why's this extension not part of core extensions?"
Wolf530 (talkcontribs)

Using MinervaNeue with MW 1.32.2, when the mobile page loads and you tap on the hamburger menu you get nothing - no pop-up.

Reply to "Hamburger menu not working"
46.211.45.135 (talkcontribs)

In mobile version not displayed radiobuttons & checkboxes (they disappear as the page loads). It's with Extension:Quiz. Help me please!

Reply to "Radiobutton & CheckBox"

Is there anyway to detect page in or not in Mobile mode?

1
Zoglun (talkcontribs)

Hi,

We are trying to add JavaScript A when user visiting Desktop page, and add JavaScript B when Mobile page. We can successfully add JS file with BeforePageDisplay hook now. But can't detect the status.

Is there any way to distinguish between Viewing status (some ways to get a if/else statement status ) from Desktop and Mobile?

Thank you!


Reply to "Is there anyway to detect page in or not in Mobile mode?"