Extension:Theme/ja

This page is a translated version of the page Extension:Theme and the translation is 25% complete.
MediaWiki 拡張機能マニュアル
Theme
リリースの状態: 安定
実装 外装
説明 Allows using themes of skins
作者 Ryan Schmidt
Jack Phoenix
Samantha Nguyen
最新バージョン 2.5.1
MediaWiki 1.43+
ライセンス Public domain
(the main PHP file is PD-licensed, while some of the actual theme files may not be)
ダウンロード
ShoutWiki
$wgDefaultTheme, $wgSkipThemes
四半期ごとのダウンロード数 35 (Ranked 94th)
使用中の公開ウィキ 1,212 (Ranked 229th)
translatewiki.net で翻訳を利用できる場合は、Theme 拡張機能の翻訳にご協力ください
問題点 未解決のタスク · バグを報告

Theme拡張機能は、テーマ(スキンの外観を変更するためのプリセットCSS)を読み込めるようにします。 Users can determine their preferred theme by configuring this in their preferences. The $wgDefaultTheme variable can be used to control what theme is being used site-wide, and the usetheme=X parameter is accepted on a request to change the theme on a per-pageload basis.

This extension was written by Skizzerz for ShoutWiki.

Installation

  • ダウンロードして、ファイルをextensions/フォルダー内のThemeという名前のディレクトリ内に配置します。
    開発者とコード寄稿者は、上記の代わりに以下を使用してGitからインストールします:cd extensions/
    git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/Theme
  • 以下のコードを LocalSettings.php ファイルの末尾に追加します:
    wfLoadExtension( 'Theme' );
    
  •   完了 – ウィキの「Special:Version」に移動して、拡張機能が正しくインストールされたことを確認します。

Parameters

  • $wgDefaultTheme controls which theme is displayed by default when users visit your wiki.
  • $wgSkipThemes (available from extension version 2.5, July 2024) allows sysadmins to disable certain themes. If you wanted to disable the StellarBook MonoBook and dark Vector themes, for example, you'd set it like so:
$wgSkipThemes = [
	'monobook' => [
		'stellarbook' => true
	],
	'vector' => [
		'dark' => true
	]
];

Available themes

Certain skins, like Bouquet, Dusk or Gamepress include themes as a part of the skin; themes can then be activated once the Theme extension is installed on your wiki.

Other skins, primarily those maintained by Wikimedia Foundation developers for use on Wikimedia Foundation websites like Wikipedia etc., do not include themes; instead their themes are located as a part of the Theme extension. Currently these kind of skins include MonoBook and Vector.

As a part of the Theme extension

For MonoBook
  • dark
  • pink
  • stellarbook
For Vector (2010)

Included with the skins themselves

Bouquet
  • forgetmenot
  • pinkdogwood
  • tigerlily
Dusk
  • green
Gamepress
  • red (default)
  • blue
  • green
  • orange

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, place the CSS file(s) there and register the new theme in Theme/extension.json file, under ResourceModules object.

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

You also need to define a top-level key called ThemeModules to list the available theme names. Here's how Gamepress does that (see Gamepress' skin.json file's master version for details):

	"ThemeModules": {
		"gamepress": [ "blue", "green", "orange" ]
	},
It seems that this only works with manifest_version v1.