Skin MinervaNeue 修改导航
来自三线的随记
PS: MinervaNeue是个skin, named Minerva,主要为移动端而生
/skins/MinervaNeue/includes/skins/SkinMinerva.php
相关代码块
/**
* Returns a data representation of the main menus
* @return array
*/
protected function getMenuData() {
$data = [
'groups' => [
$this->getDiscoveryTools(),
$this->getMyMenu(), //custom navigation control function
$this->getPersonalTools(),
$this->getConfigurationTools(),
],
'sitelinks' => $this->getSiteLinks(),
];
return $data;
}
/**
* My Menu link
* Power by WILO
* @return array
*/
protected function getMyMenu() {
$config = $this->getConfig();
$menu = new MenuBuilder();
// Category link 1
$menu->insert( 'Category1' )
->addComponent(
'Windows',
'./Category:Windows',
MobileUI::iconClass( 'mf-watchlist', 'before' )
);
// Category link 2
$menu->insert( 'Category2' )
->addComponent(
'Linux',
'./Category:Linux',
MobileUI::iconClass( 'mf-watchlist', 'before' )
);
//Category link 3
$menu->insert( 'Category3' )
->addComponent(
'Mysql',
'./Category:Mysql',
MobileUI::iconClass( 'mf-watchlist', 'before' ));
//Category link 4
$menu->insert( 'Category4' )
->addComponent(
'Ctf',
'./Category:Ctf',
MobileUI::iconClass( 'mf-watchlist', 'before' ));
//Category link 5
$menu->insert( 'Category5' )
->addComponent(
'Other',
'./Category:Other',
MobileUI::iconClass( 'mf-watchlist', 'before' ));
//Category show
$menu->insert( 'ShowAllCategories' )
->addComponent(
'所有分类',
'./Special:Categories',
MobileUI::iconClass( 'mf-watchlist', 'before' ));
//Category show
$menu->insert( 'ShowAllPages' )
->addComponent(
'所有页面',
'./Special:AllPages',
MobileUI::iconClass( 'mf-watchlist', 'before' ));
return $menu->getEntries();
}