]> scripts.mit.edu Git - autoinstalls/mediawiki.git/blobdiff - docs/skin.txt
MediaWiki 1.30.2
[autoinstalls/mediawiki.git] / docs / skin.txt
index 82a5b72ec1aed727bb71af8a5ac74e14ff603ea3..a3c8c3347aa0fd4d2a963add5e6ace722e39714b 100644 (file)
@@ -1,48 +1,82 @@
-
 skin.txt
 
-This document describes the overall architecture of MediaWiki's HTML rendering
-code as well as some history about the skin system. It is placed here rather
-than in comments in the code itself to help reduce the code size.
+MediaWiki includes four core skins:
+
+* Vector: The default skin. Introduced in the 1.16 release (2010), it has been
+  set as the default in MediaWiki since the 1.17 release (2011), replacing
+  Monobook.
+
+* Monobook: Named after the black-and-white photo of a book in the page
+  background. Introduced in the 2004 release of 1.3, it had been the
+  default skin since then, before being replaced by Vector.
+
+* Modern: An attractive blue/grey theme with sidebar and top bar. Derived from
+  Monobook.
+
+* Cologne Blue: A lightweight skin with minimal formatting. The oldest of the
+  currently bundled skins, largely rewritten in 2012 while keeping its
+  appearance.
+
+
+Several legacy skins were removed in the 1.22 release, as the burden of
+supporting them became too heavy to bear. Those were:
+
+* Standard (a.k.a. Classic): The old default skin written by Lee Crocker during
+  the phase 3 rewrite, in 2002.
+
+* Nostalgia: A skin which looks like Wikipedia did in its first year (2001).
+  This skin is now used for the old Wikipedia snapshot at
+  http://nostalgia.wikipedia.org/
+
+* Chick: A lightweight Monobook skin with no sidebar. The sidebar links were
+  given at the bottom of the page instead.
+
+* Simple: A lightweight skin with a simple white-background sidebar and no top
+  bar.
+
+* MySkin: Essentially Monobook without the CSS. The idea was that it could be
+  customised using user-specific or site-wide CSS (see below).
+
+
+== Custom CSS/JS ==
 
-== Version 1.4 ==
+It is possible to customise the site CSS and JavaScript without editing any
+server-side source files. This is done by editing some pages on the wiki:
 
-MediaWiki still use the PHPTal skin system introduced in version 1.3 but some
-changes have been made to the file organisation.
+* [[MediaWiki:Common.css]] -- for skin-independent CSS
+* [[MediaWiki:Common.js]] -- for skin-independent JavaScript
+* [[MediaWiki:Vector.css]], [[MediaWiki:Monobook.css]], etc. -- for
+  skin-dependent CSS
+* [[MediaWiki:Vector.js]], [[MediaWiki:Monobook.js]], etc. -- for
+  skin-dependent JavaScript
 
-PHP class and PHPTal templates have been moved to /skins/ (respectivly from
-/includes/ and /templates/). This way skin designer and end user just stick to
-one directory.
+These can also be customised on a per-user basis, by editing
+[[User:<name>/vector.css]], [[User:<name>/vector.js]], etc.
 
-Two samples are provided to start with, one for PHPTal use (SkinPHPTal.sample)
-and one without (Skin.sample).
 
+== Custom skins ==
 
-== Version 1.3 ==
+Several custom skins are available as of 2014.
 
-The following might help a bit though.
+https://www.mediawiki.org/wiki/Category:All_skins
 
-Firstly, there's Skin.php; this file will check various settings, and it 
-contains a base class from which new skins can be derived.
+Installing a skin requires adding its files in a subdirectory under skins/ and
+adding an appropriate require_once line to LocalSettings.php, similarly to how
+extensions are installed.
 
-Before version 1.3, each skin had its own PHP file (with a sub-class to Skin) 
-to generate the output. The files are:
- * SkinCologneBlue.php
- * SkinNostalgia.php
- * SkinStandard.php
- * SkinWikimediaWiki.php
-If you want to change those skins, you have to edit these PHP files.
-Since 1.3 a new special skin file is available: SkinPHPTal.php. It makes use of
-the PHPTal template engine and allows you to separate code and layout of the
-pages. The default 1.3 skin is MonoBook and it uses the SkinPHPTAL class.
+You can then make that skin the default by adding:
+  $wgDefaultSkin = '<name>';
 
-To change the layout, just edit the PHPTal template (templates/xhtml_slim.pt) 
-as well as the stylesheets (stylesheets/monobook/*).
+Or disable it entirely by removing the require_once line. (User settings will
+not be lost if it's reenabled later.)
 
+See https://www.mediawiki.org/wiki/Manual:Skinning for more information on
+writing new skins.
 
-== pre 1.3 version ==
 
-Unfortunately there isn't any documentation, and the code's in a bit of a mess
-right now during the transition from the old skin code to the new template-based
-skin code in 1.3.
+Until MediaWiki 1.25 it used to be possible to just put a <name>.php file in
+MediaWiki's skins/ directory, which would be loaded and expected to contain the
+Skin<name> class. This way has always been discouraged because of its limitations
+(inability to add localisation messages, ResourceLoader modules, etc.) and
+awkwardness in managing such skins. For information on migrating skins using
+this old method, see <https://www.mediawiki.org/wiki/Manual:Skin_autodiscovery>.