Jump to content

Extension:SkinPerNamespace

From mediawiki.org
Revision as of 20:35, 31 March 2008 by IAlex (talk | contribs) (new extension)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
MediaWiki extensions manual
SkinPerNamespace
Release status: beta
Implementation Hook
Description allows a per-namespace skin
Author(s) Alexandre Emsenhuber
Latest version 2018-01-26
MediaWiki 1.12
$wgSkinPerNamespace, $wgSkinPerNamespaceOverrideLoggedIn
Licence GPLv2 or higher
Download svn (browse)

This extension allow to specify a per-namespace skin that can be configured in $wgSkinPerNamespace, but this will also override users preferences, to avoid this you can set $wgSkinPerNamespaceOverrideLoggedIn to false.

Installation

Download SkinPerNamespace.php and put it in extensions/SkinPerNamespace directory of your MediaWiki installation, then edit LocalSettings.php and add the following line :

require_once( "$IP/extensions/SkinPerNamespace/SkinPerNamespace.php" );

Configuration

You can configure this extension with to variables :

  • $wgSkinPerNamespace : array mapping namespaces index (i.e. namespaces numbers and not names) to a skin name. Use all lower case name for skin, like monobook, modern, ... otherwise it simply won't work. Example:
$wgSkinPerNamespace[NS_TALK] = "modern";
$wgSkinPerNamespace[NS_PROJECT] = "cologneblue";
Note: you can find the constants in includes/Defines.php.
  • $wgSkinPerNamespaceOverrideLoggedIn, if set to true (default value), it will also override the the skin for logged in users, to avoid this you can set it to false and $wgSkinPerNamespace will only apply to anonymous users.

Note Note: This also work for some special pages, but not all, as this extension use SpecialPageExecuteBeforePage to change the skin and this hook is not called when using special pages defined by extensions or the following pages from the core of MediaWiki :

See also