问题
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