Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

Is there any way to use a different theme file for a Mediawiki's front page, while the rest of the wiki uses the standard theme you set? For example, say I use Monobook.php for all of my regular pages, but Custom.php for my wiki's front page. I can't find anything that would allow me to do this.

share|improve this question

migrated from stackoverflow.com Sep 23 '12 at 23:11

This question came from our site for professional and enthusiast programmers.

add comment

1 Answer 1

Sure. All you need to do is use a hook, check if the current $wgTitle is the same as the main page title, and if it is, switch the Skin object to a different skin.

The hook you should use for this is RequestContextCreateSkin.

The Skin object is passed by reference there, so you should have no trouble replacing it with a custom skin of your choice.

Good luck.

share|improve this answer
1  
BeforePageDisplay might be a little late to change the skin. I'd suggest RequestContextCreateSkin instead. –  Ilmari Karonen Sep 22 '12 at 18:40
    
Good point. Edited answer. –  tor Sep 23 '12 at 3:27
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.