Manual:Skin configuration/zh

This page explains how to configure skins on a wiki for administrators.

此页面包含了管理员如何在一个维基中配置皮肤的所有信息. 一般的维基皮肤信息，请参考Help:Skins，如何开发一个新皮肤请参考Manual:Skinning.

本文档适用于MediaWiki 1.24及更高版本.

下载皮肤
MediaWiki压缩包下载拥有四款皮肤：Vector（默认皮肤）、MonoBook、Modern和Cologne Blue. 如果您使用它安装了MediaWiki的话，您已经有皮肤了！

然而，如果你从from Git下载的MediaWiki或者下载了nightly版本，又或者打算安装额外的皮肤，你需要单独下载皮肤的代码.

许多MediaWiki的皮肤都包含在Wikimedia的Git仓库（查看全部列表here）. 你可以从skin distributor下载皮肤压缩包.

想通过GIT下载库里面的皮肤，你可以使用一下命令

 git clone https://gerrit.wikimedia.org/r/mediawiki/skins/[name of skin]

比如：获取默认皮肤Vector，你可以在 目录使用以下语句

 git clone https://gerrit.wikimedia.org/r/mediawiki/skins/Vector

Checkout an appropriate release of the skin. Change into the new directory and run:

git checkout REL1_27 (or other release version or tag)

当你获得了一个皮肤文件的文件包，把它放到你的MediaWiki安装目录的 目录中（你可以把Git仓库直接放目录里）.

启用皮肤
想使用任何在你的/skins目录里的皮肤，你必须添加一个 语句在文件中 举个例子：想启动Vector，添加以下语句. If you have multiple skins, each must be enabled with a separate statement:



(这和启用扩展类似, 只是目录不一样.)

根据皮肤的选择可能有额外的步骤. 每个皮肤安装的细节介绍已经存在于mediawiki.org每个皮肤的页面中；比如Vector可以参考Skin:Vector#Installation. 其他皮肤的介绍也是类似的.

设置wiki的默认皮肤
在 中的 变量中指定皮肤的小写的名可以为新用户设定一个设定一个默认的皮肤. 用户仍然可以通过参数设置页面修改自己的皮肤，除非你卸载或禁用其他所有的皮肤，或者完全禁用偏好（见下文）. 例如：

在维基中改变这些值将自动更改所有使用默认皮肤用户的设置. 参数维护脚本可以改变用户的喜好(userOptions.php)，但你很可能不需要使用它.

如果你不更改这个值，Vector就是默认皮肤

卸载皮肤
要卸载皮肤，从您的LocalSettings.php文件移除 一行. 之后您可以从 目录移除皮肤文件.

如果任何用户使用已经被卸载的皮肤，MediaWiki会自动将它们转换到wiki的默认皮肤.

在不卸载的情况下停用皮肤
The administrator can limit the skin choices that are offered site-wide in user's preferences by listing skin(s) to suppress in the  array. This might be useful if you want to test a new skin without letting users see it. To do this, put something like this in :

You will be able to preview the skin using the useskin URL parameter.

Site-wide CSS modifications
MediaWiki allows administrators to specify site-wide CSS rules to be added to every page rendered. These rules can be added by editing the page Common.css on your wiki, if  is set to true. In addition to a global stylesheet, one can also specify CSS rules to be used only in certain skins (see Manual:Interface/Stylesheets).

User CSS modifications
Users can also specify their own CSS rules by creating the page "User:Username/common.css". The CSS on this page is then applied to whatever skin the user is using. If the website is changed to a different default skin, the user's custom CSS will continue to work just as before. This feature can be enabled by setting  to true in. A user can also apply CSS to a specific skin by creating the page "User:Username/skinname.css". If a user uses the MonoBook skin for example, they would edit the page Special:MyPage/monobook.css.

Disable site users' ability to choose skins in user preferences
The system administrator can completely remove the "Skin" option so that it does not show up at all in User Preferences. This makes sense if your site will use a customized skin and would not look right in any other skin.

To do it, add a new line containing the following code to LocalSettings.php. It will remove the "Skin" option from preferences and the possibility to use the useskin parameter in the URL.