如何在不破坏外观的情况下向MediaWiki网站添加水平顶部菜单栏? [英] How do I add a horizontal top menu bar to a MediaWiki site without hacking the skin?

查看:118
本文介绍了如何在不破坏外观的情况下向MediaWiki网站添加水平顶部菜单栏?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望我的MediaWiki网站在页面顶部具有(除了侧边栏之外或代替边栏)在每个页面上都可见的链接栏.

I want my MediaWiki site to have (either in addition to, or instead of, the sidebar) a bar of links at the top of the site, visible on every page.

为了最大程度地减少将来的维护负担,我的要求是:

To minimize future maintenance burden, my requirements are:

  1. 不对核心代码,扩展代码或外观代码进行修改.我不想维护项目分支.

  1. No modifications to core, extension or skin code. I do not want to maintain project forks.

理想情况下,特权用户应该能够通过编辑特殊页面来编辑菜单栏中显示的链接,类似于MediaWiki:Sidebar如何控制常用边栏的内容.

Ideally, privileged users should be able to edit the links shown in the menu bar by editing a special page, similar to how MediaWiki:Sidebar controls the content of the usual sidebar.

我尝试过的解决方案

  • Topbar扩展看起来很理想,但是确实似乎不适用于最新的MediaWiki版本(有关详细信息,请参见我的SO问题#37423269 ).

    Solutions I have tried

    • The Topbar extension looks like an ideal solution, but it does not seem to work with the latest MediaWiki versions (see my SO question #37423269 for details if interested).

      MegaMenu扩展看起来很棒,但是具有侵入性的安装过程这违反了我上面的要求#1.它还需要编辑一个PHP文件来更改链接,这违反了#2.

      The MegaMenu extension looks awesome, but has an invasive installation procedure which violates my requirement #1 above. It also requires editing a PHP file to change the links, which violates #2.

      Erudite 的皮肤很漂亮,并内置了对顶部菜单栏.但是在我的测试中,顶部菜单栏区域为空,侧栏显示在页脚页的最底部.皮肤文档没有说明如何自定义顶部菜单栏内容.

      The Erudite skin is beautiful, with built-in support for a top menu bar. But in my test, the top menu bar area was empty, and the sidebar was rendered at the very bottom of the page in the footer. The skin documentation does not explain how to customize the top menu bar content.

      我在这里俯瞰着什么吗?其他MediaWiki网站如何做到这一点?

      Is there something obvious I am overlooking here? How do other MediaWiki sites do this?

      推荐答案

      深入研究Erudite外观后,我了解到它的水平顶部菜单栏是从MediaWiki:Sidebar的导航"部分绘制的. (我的特殊问题是,我将该节的首字母大写为"Navigation",而不是所有小写字母为"navigation";当我对此进行更改时,我开始在顶部菜单中看到链接.)

      After digging further into the Erudite skin, I learned that its horizontal top menu bar is drawn from the "navigation" section of the MediaWiki:Sidebar. (My particular problem was that I had that section labeled capitalized as "Navigation" rather than all lower case as "navigation"; when I changed that, I started seeing links in the top menu.)

      因此,对于该皮肤,侧边栏可能类似于:

      So with that skin, the sidebar might look something like:

      * navigation
      ** Welcome|Welcome
      ** Downloads|Downloads
      ** Help|Contact and Help
      
      * Learn
      ** Introduction|Introduction
      ** User Guides|User Guides
      ** Tutorials|Tutorials
      
      * Develop
      ** Development|Overview
      ** Scripting|Scripting
      ** Source code|Source code
      

      菜单将呈现类似于:

      如果仍然缺少一些内置的MediaWiki功能,例如,我仍然很感兴趣.使用Vector皮肤或常用的扩展名.

      I'd still be interested to hear if I am missing some built-in MediaWiki functionality, e.g. with the Vector skin, or a common widely used extension.

      这篇关于如何在不破坏外观的情况下向MediaWiki网站添加水平顶部菜单栏?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆