Extension:ForceSkin

Category:Extensions without an imageCategory:Extensions without a compatibility policyCategory:GPL licensed extensions
MediaWiki extensions manual
ForceSkin
Release status: stableCategory:Stable extensions
Implementation Skin Category:Skin extensions
Description Allows wiki system administrators on a wiki farm to force all site users to use a specified skin despite multiple skins being loaded in configuration
Author(s) Jack Phoenixtalk
Latest version 2.0
MediaWiki 1.39+Category:Extensions with manual MediaWiki version
License GNU General Public License 2.0 or later
Download Category:Extensions in Wikimedia version control
  • $wgForceSkin
Translate the ForceSkin extension if it is available at translatewiki.net
Category:All extensions

The ForceSkin extension allows wiki system administrators on a wiki farm to force all site users to use a specified skin, despite multiple skins being loaded in configuration. It probably isn't very useful outside wiki farm setups — if you're running a single wiki and you wish not to make a skin available, just don't load it. For wiki farm setups, though, usually a set of skins is loaded in a single, global (wiki farm wide) setup file and thus it's significantly harder to "disable" a skin.

Additionally there's a feature for super lazy developers (like myself): provided that the $wgForceSkin global variable is not set, you can use this extension to make the ?useskin= URL parameter "stick", i.e. to change your skin without logging in. This is even more of a specific functionality catering to a very narrow audience.

This extension is based on an idea and the "SkinForce" extension written by David Pean for ArmchairGM. It was rewritten from scratch by Jack Phoenix on 17 October 2023 to support modern MediaWiki versions.

Installation

  • Download and move the extracted ForceSkin folder to your extensions/ directory.
    Developers and code contributors should install the extension from Git instead, using:
    cd extensions/
    git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/ForceSkin
    
  • Add the following code at the bottom of your LocalSettings.php file:
    wfLoadExtension( 'ForceSkin' );
    
  • Configure as required.
  • Yes Done – Navigate to Special:Version on your wiki to verify that the extension is successfully installed.

Configuration

$wgForceSkin
The internal name of the skin to force on all users (default: empty string, i.e. users are allowed to choose a skin other than the default skin in their preferences, provided that multiple skins are installed). Internal names are all lowercase, e.g. hassomecolours instead of HasSomeColours, monobook instead of MonoBook, webplatform instead of WebPlatform, etc.
Category:All extensions Category:Extensions in Wikimedia version control Category:Extensions with manual MediaWiki version Category:Extensions without a compatibility policy Category:Extensions without an image Category:GPL licensed extensions Category:GetCacheVaryCookies extensions Category:GetPreferences extensions Category:RequestContextCreateSkin extensions Category:Skin extensions Category:Stable extensions