如何添加带有外部链接的自定义选项卡按钮? [英] How to add custom tab button with external link?
本文介绍了如何添加带有外部链接的自定义选项卡按钮?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
使用Mediawiki 1.19,并希望在选项卡按钮页面"和讨论"旁边添加带有外部链接的选项卡.怎么做?
Using Mediawiki 1.19 and want to add tabs with external links right next to the tab buttons 'Page' and 'Discussion'. How to do it?
- 扩展名:DynamicTabs无效,因为它对矢量皮肤有麻烦.
- 中的步骤:常见问题解答:如何在整个Wiki中添加/删除选项卡?根本没有任何作用.
- Extension:DynamicTabs does not work because it has trouble with vector skins.
- Steps in FAQ: How do I add/remove tabs throughout my wiki? do not have any effect at all.
推荐答案
常见问题解答中的代码已过时.对于MediaWiki的较新版本,您必须使用 SkinTemplateNavigation 钩子代替 SkinTemplateContentActions 挂钩.我更新了常见问题解答.基本上,您需要执行以下操作:
The code in the FAQ was outdated. For newer versions of MediaWiki, you have to use the SkinTemplateNavigation hook instead of the SkinTemplateContentActions hook. I updated the FAQ. Basically, you need to do something like this:
$wgHooks['SkinTemplateNavigation'][] = 'replaceTabs';
function replaceTabs( $skin, &$links) {
$links['namespaces']['name_of_tab'] = array(
'class' => false or 'selected', // if the tab should be highlighted
'text' => 'text_of_tab', // what the tab says
'href' => 'url_to_point_to', // where it links to
'context' => 'main',
);
return true;
}
这篇关于如何添加带有外部链接的自定义选项卡按钮?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文