To enable AMC on your private wiki. In LocalSettings.php
:
wfLoadSkin( 'MinervaNeue' ); ... $wgMinervaAdvancedMainMenu = ['base' => true]; $wgMinervaPersonalMenu = ['base' => true];
Then, in skins/MinervaNeue/includes/Menu/User/AdvancedUserMenuBuilder.php
replace the getGroup
method with the following code and set the mobile-frontend-user-create-account
message.
public function getGroup( array $personalTools ): Group { $group = new Group( 'p-personal' ); if ( $this->user->isAnon() ) { $entry = SingleMenuEntry::create( 'userContributions', $this->messageLocalizer->msg( 'mobile-frontend-user-create-account' )->escaped(), \SpecialPage::getSafeTitleFor('Create_account')->getLocalURL() ); $group->insertEntry( $entry ); $this->definitions->insertLogInMenuItem( $group ); Hooks::run( 'MobileMenu', [ 'user', &$group ] ); return $group; } $group->insertEntry( new ProfileMenuEntry( $this->user ) ); $talkPage = $this->user->getUserPage()->getTalkPageIfDefined(); if ( $talkPage ) { $entry = SingleMenuEntry::create( 'userTalk', $this->messageLocalizer->msg( 'mobile-frontend-user-page-talk' )->escaped(), $talkPage->getLocalURL() ); $entry->setIcon( 'userTalk', 'before' ); $group->insertEntry( $entry ); } $this->definitions->insertWatchlistMenuItem( $group ); $this->definitions->insertContributionsMenuItem( $group ); $this->definitions->insertLogOutMenuItem( $group ); Hooks::run( 'MobileMenu', [ 'user', &$group ] ); return $group; }
This code assumes that your wiki is private, but that users are free to create an account. If that is not the case, simply remove the line that adds a link to create an account.
If someone is willing to make that menu adapt to user permissions and commit it to the Minerva skin that would be great.