Different sidebar for mediawiki pages

感情迁移 提交于 2020-01-02 07:26:08

问题


I have edited my sidebar as follows ,

*Navigation
** Projects|Projects
** Resources|Resources
** IRC Support|IRC Support
** Media Wiki Archive|Media Wiki Archeive
**Vote on What We Do|Vote on What We Do
* SEARCH
* TOOLBOX
* LANGUAGES 

i would like to have 3 different sidebar for 3 different pages ,my first page is http://www.hh.com/wiki/Main_Page

for this page i would like to have the sidebar as

*Navigation
**Hello|Hello
* SEARCH
* TOOLBOX
* LANGUAGES

for another i would like to have http://www.hh.com/wiki/Page1

*Navigation
**Page1|page1
* SEA1RCH
* TOOLBOX
* LANGUAGES

My Question is, is it possible to have different sidebar for differnt pages in media wiki


回答1:


You need Extension:ParserFunctions.

Create page (for example Sidebar1) with contents:

*Navigation
**Hello|Hello
* SEARCH
* TOOLBOX
* LANGUAGES

Create other page (for example Sidebar2) with contents:

*Navigation
**Page1|page1
* SEA1RCH
* TOOLBOX
* LANGUAGES

And in MediaWiki:Sidebar you can write something like:

{{#ifeq: {{PAGENAME}} | Main_Page | {{:Sidebar1}} | 
    {{#ifeq: {{PAGENAME}} | Page1 | {{:Sidebar2}} |  }}
}}

Change {{PAGENAME}} if needed Magic words



来源:https://stackoverflow.com/questions/19583763/different-sidebar-for-mediawiki-pages

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!