Jump to content

Extension:Theme: Difference between revisions

From mediawiki.org
Content deleted Content added
Rejected the last text change (by 178.168.12.239) and restored revision 442170 by Jack Phoenix: edit test
m This extension appears to be in SVN, not Git.
Line 10: Line 10:
|license = [[wikipedia:Public domain|Public domain]]<br />(the main PHP file is PD-licensed, while some of the actual theme files may not be)
|license = [[wikipedia:Public domain|Public domain]]<br />(the main PHP file is PD-licensed, while some of the actual theme files may not be)
|parameters = $wgDefaultTheme
|parameters = $wgDefaultTheme
|download = {{WikimediaDownload}}
|download = {{WikimediaDownload}}
|example = [http://www.shoutwiki.com/wiki/Main_Page?useskin=monobook&usetheme=dark ShoutWiki]
|example = [http://www.shoutwiki.com/wiki/Main_Page?useskin=monobook&usetheme=dark ShoutWiki]
}}
}}

Revision as of 22:55, 13 August 2012

MediaWiki extensions manual
Theme
Release status: stable
Implementation Skin
Description Allows using themes of skins
Author(s) Ryan Schmidt
Jack Phoenix
Latest version 1.5
MediaWiki 1.17+
License Public domain
(the main PHP file is PD-licensed, while some of the actual theme files may not be)
Download Template:WikimediaDownload/svn
Example ShoutWiki
$wgDefaultTheme
Quarterly downloads 33 (Ranked 101st)
Public wikis using 1,212 (Ranked 229th)
Translate the Theme extension if it is available at translatewiki.net

The Theme extension allows loading of themes (preset CSS to change the appearance of a skin). Currently, the $wgDefaultTheme variable can be used to control what theme is being used site-wide, and the usetheme=X parameter is accepted in LocalSettings.php to change the theme on a per-pageload basis. Future versions of this extension will also add fields to Special:Preferences to allow changing the theme on a per-account basis.

This extension was written by Skizzerz for ShoutWiki.

Installation

  1. Get the source code, either directly from SVN or via ExtensionDistributor
  2. Add
    require_once("$IP/extensions/Theme/Theme.php");
    
    to your wiki's LocalSettings.php
  3. Installation can now be verified through Special:Version on your wiki

Parameters

$wgDefaultTheme controls which theme is displayed by default when users visit your wiki.

Adding themes

To add a new theme for a core skin (such as Modern or Vector), create a directory called skinname (i.e. vector) under $IP/extensions/Theme and place the CSS file(s) there.

To add a new theme for a custom skin, register a module for each theme in the skin's main setup file. The naming convention is skins.skinname-in-lowercase.themename-in-lowercase; for example, the module name of the AutumnLeaf theme for the BlueCloud skin would be skins.bluecloud.autumnleaf.