Jump to content
MediaWiki

Extension:ForceSkin

From mediawiki.org
MediaWiki extensions manual
ForceSkin
Release status: stable
Implementation Skin
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 Phoenix talk
Latest version 2.0
MediaWiki 1.39+
  • $wgForceSkin
Licence GNU General Public License 2.0 or later
Download
Translate the ForceSkin extension if it is available at translatewiki.net

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

[edit ]
  • Download and move the extracted ForceSkin folder to your extensions/ directory.
    Developers and code contributors should install the extension from Git instead, using:
    cdextensions/
    gitclonehttps://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

[edit ]
$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.

AltStyle によって変換されたページ (->オリジナル) /