Topic on Extension talk:MobileFrontend

How do I include sidebar links in mobile menu?

12
Summary by Jdlrobson
Derrickfarnell (talkcontribs)

Hello

I've just noticed that the sidebar links in my site:

http://credulism.org/

don't appear in the mobile version menu. Is there any way to achieve this?

Jdlrobson (talkcontribs)

This is the subject of a longstanding bug. The menu in mobile is currently not customisable as the default desktop menu is too large and not always relevant to mobile users for a variety of reasons.

We've got a few ideas but nothing concrete. There are a couple of hooks you can use in the mean time.

https://phabricator.wikimedia.org/T65459

Derrickfarnell (talkcontribs)

Okay, thanks. The page you link to is too advanced for me - I'm a researcher in psychology, and only have enough knowledge and skill to install MW via cPanel, and make changes to site files, such as LocalSettings.php, in accordance with explicit instructions. Is there a relatively simple way to at least have the first section of links, just below the logo, in the mobile menu? In fact, I really only need one of those links to appear in the mobile menu - the link to the page 'Contents' in my wiki.

Jdlrobson (talkcontribs)

Try (untested):

$wgHooks['MinervaDiscoveryTools'][] = function( &$items ) {
$items[] = array(
				'name' => 'contents',
				'components' => array(
					array(
						'text' => 'Contents',
						'href' => '/wiki/Contents',
						'class' => MobileUI::iconClass( 'contents', 'before' ),
					),
				),
			);
};
Derrickfarnell (talkcontribs)

Thanks very much for your help - where do I put it?!

I've tried MediaWiki:Common.css, but that didn't work, even after a hard refresh.

Jdlrobson (talkcontribs)

LocalSettings.php!

Derrickfarnell (talkcontribs)

Thanks.

However, the site just disappears - the page is just completely white, without even an error message. I've now removed the code.

Florianschmidtwelzow (talkcontribs)
Jdlrobson (talkcontribs)

My code was bad. Try again - I edited it above.

Derrickfarnell (talkcontribs)
Jdlrobson (talkcontribs)

Sounds like you have an older version of MobileFrontend. Try updating to current master.

Derrickfarnell (talkcontribs)

I've uploaded the current version of the extension, but the problem still exists, alas.