Manual:Skinning/Archive/zh

此页面包含关于如何创建一个 MediaWiki 皮肤的指示说明.

这里将用 FooBar 这一占位符作为新创建的皮肤的名称. （注意在不同的上下文中分别应用了大写的  和小写的   ）

这里有一些更为常规的演练 在元维基上.

文件位置
All skin files are located in the  subfolder of the MediaWiki installation directory (see $wgStylePath and $wgStyleDirectory for actual location.)

对于每个皮肤，在此文件夹中都有两个文件：
 * ：主文件，对页面的布局做出了定义.
 * ：针对 PHP 5 中在 APC 编码缓存的一个 bug 的暂时解决措施.

应创建与皮肤名称相同的子文件夹来放置所有其它的文件，例如：
 * ： FooBar 的主样式表
 * : 对特定浏览器的样式表修正

代码结构和元素Code Structure and Elements
此部分将是对一个典型的 MediaWiki 皮肤的代码结构的概述.

各自的代码结构是从典型的 MediaWiki 皮肤 MonoBook 中取出的. 要获得完整的 PHP 代码，请见 Manual:Skinning/Example.

Dependencies
This section contains the dependency information about the skin to work around a caching bug in PHP 5.

元数据（Metadata）
此部分包含此皮肤的元数据信息.

初始化
This section sets up your skin to inherit from the main skin template class and shows the beginning of the template callback class. Here the required classes are defined. Instances of  and   need to be replaced with the skin's name. Usually nothing else in this section needs to be altered.

Page Elements
The following sections consist of page elements that your skin can use with an example usage. You can use page elements in whatever order you like or alter the way you use these elements. Elements presented below are in the order that the Monobook skin uses them.

Site Notice
[在不同条件下会改变]

Page Subtitle
(e.g. redirect notice)

Undelete Notice
[conditional]

用户消息通知
[在不同条件下会改变]

跳转到链接
(页内导航) [在不同条件下会改变], [可选的]

Category Links
[conditional]

Page Toolbar
[iterative]

用户工具条
[迭代]

侧边栏导航
[迭代]

页脚
[迭代]

结尾部分
此部分简单地结束以上所有的部分，通常不需要改变.

Category List Fix
This is a fix for returning category links as a proper  element (instead of returning a mostly unordered string, which is the default behavior). These functions need to be placed in the class that extends SkinTemplate in your template file. If you want to see the mediawiki versions of these functions, look for them in Skin.php.

另见

 * Manual:Skins/zh MediaWiki 皮肤概述
 * Gallery of user styles - (non-official skins)
 * Manual:Skinning/Vector - Extend Vector skin in MediaWiki 1.17
 * Manual:Skinning/Tutorial

External

 * MediaWiki Skins Design: Designing attractive skins and templates for your MediaWiki site by Richard Carter, ISBN 978-1847195203
 * SiteGround Tutorial about MediaWiki Skins
 * Creating a subskin for MediaWiki 1.18+ by Daniel Friesen under his employer Redwerks