1

I'm working on a group of related wikis. I want $wgSitename to show up prominently in the left sidebar. What's a good way to do this?

I could hack the skin but this is not a good way. I looked into MediaWiki:Sidebar but there's no obvious way to get the site name in there.

There will be more than 10 wikis and I don't want to create a different logo for each wiki.

  • use the logoimage instead? – JamesRyan Jun 22 '15 at 14:35
  • Don't really want to do that with 10 different wikis. I want to keep it as simple as possible. I'm currently thinking pywikibot may be the best way to do that since I'll be using pwb anyway and I could just write a couple of lines in Python that update MediaWiki:Sidebar based on $wgSitename but I'm still hoping for a simpler solution. – guaka Jun 22 '15 at 21:24
3

You can add * {{SITENAME}} to MediaWiki:Sidebar and use some script to replicate that, or use the AddMessages extension or the MessagesPreLoad hook to set the text from code.

  • Thanks. I think I tried something like this but didn't get it to work before. In fact * {{SITENAME}} and ** {{SITENAME}} don't work, but ** mainpage|{{SITENAME}} works well for me. – guaka Jun 30 '15 at 16:55
  • Yeah, looks like headings cannot fall back to be plain strings, they must be messages. So you must put {{SITENAME}} into MediaWiki:Something (or dynamically via the hook) and refer to that. – Tgr Jul 1 '15 at 5:25
  • If you don't care about the sitename being in the heading, you can also use the SkinBuildSidebar hook, that gives you more control. – Tgr Jul 1 '15 at 5:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.