Jump to content

Template:皮肤

问题追踪器: [[phab:tag/{{{phabricator}}}/|#{{{phabricator}}}]]
From mediawiki.org
This page is a translated version of the page Template:Skin and the translation is 80% complete.
Outdated translations are marked like this.
模板文档
MediaWiki皮肤手冊 - 分类
{{{localised name}}}
发行状态: 未知
描述 {{{description}}}
作者 SomeAuthor
最新版本 {{{version}}} ({{{update}}})
最新预览版本 {{{version preview}}} ({{{update preview}}})
兼容性政策 无效
MediaWiki {{{mediawiki}}}
PHP {{{php}}}
Composer {{{composer}}}
许可协议 {{{license}}}
下载 {{{download}}}
{{{readme}}}
{{{changelog}}}
示例 {{{example}}}
参数
{{{parameters}}}
{{{compatibility}}}
翻譯Skin皮肤如果它在translatewiki.net是可用的話
Vagrant角色 {{{vagrant-role}}}
问题 [[phab:tag/{{{phabricator}}}|开启的任务]] · 报告错误

此模板应添加到本wiki上的所有皮肤页面(但仅限于主页)以显示信息框并对皮肤进行分类。

用法

复制粘贴:

{{Skin|templatemode =
|name                 = 
|localised name       = 
|status               = 
|hook1                = 
|hook2                = 
|newhook1             = 
|newhook2             = 
|username             = 
|author               = 
|description          = 
|image                = 
|imagesize            = 
|version              = 
|update               = 
|version preview      = 
|update preview       = 
|compatibility policy =
|mediawiki            = 
|php                  = 
|composer             =
|license              = 
|download             = 
|readme               = 
|changelog            = 
|example              = 
|parameters           = 
|compatibility        = 
|bugzilla             = 
|phabricator          =
|vagrant-role         =
}}

关于参数值的说明,请见下方

內容参数

此段描述控制信息框內容的參數。 關於templatemode和其他的控制參數,请見控制參數

內容参数
参数 描述
name皮肤名
localised name 用于本地化皮肤名的源文本

指定与name相同的值。

之后将被用于本地化名称。
status当前发行状态

有效值:

  • unstable - 目前已损坏 - 請不要在最新的MediaWiki版本中使用此皮肤
  • experimental - 开发的早期阶段,可能有巨大改變
  • beta - 穩定但尚未進行全面性的測試
  • stable - 穩定版 - 此皮肤在最新的MediaWiki版本中運作良好,未出現任何致命錯誤。
  • unmaintained - 未維護 - 僅在所連結的儲存庫已被歸檔、或維護者對於查詢有關維護狀態未回應之時使用。 若使用此狀態,請使用HTML註解,連結至某個修補程式或問題/錯誤報告作為參考的依據。 若皮肤已損壞,請改用unstable
  • unknown - 默认

如果狀態填寫為以上值以外的值,其將會被忽略,在模板中會展示成預設值「未知」。

hook1
hook2
hook3
hook4
...
hook90
此扩展使用的所有钩子的名字

在此字段添加值有助于扩展开放,帮助其他开发者。 每个有文档的钩子会自动将扩展添加到使用相应钩子的扩展的分类。 此分类会自动链接到每个钩子页面,程序员可以借此轻松找到某扩展使用的某钩子的示例。

对于内置钩子:

  • 单独使用钩子名。 請參閱Manual:Hooks 以獲取值(但請省略開頭的'/')。

對於由擴充功能定義的自訂鉤點:

對於多個鉤點,將第一個鉤點指派給hook1、第二個鉤點指派給hook2,依此類推。
newhook1
newhook2
newhook3
newhook4
...
newhook90

此扩展提供的所有钩子的名字


username 作者在MediaWiki.org上的用户名(若有)。 可以省略,但若存在,则会自动链接到作者的用户页和用户讨论页。 应在没有命名空间和[[]]的情况下提供。
author 皮肤的作者名,如果和MediaWiki.org上的不同。 任意文字。 若省略,则使用“username”字段(若有值)。
description 简述
image 皮肤的截图或Logo。 应在没有命名空间和[[]]的情况下提供。
imagesize facultative, size of the image (default size is 220px)
version 最后版本
update最後更新日期
compatibility policy 兼容性政策 (可选值有masterrelltsrel). (backlog )
mediawiki要求的MediaWiki版本
php要求的PHP版本
licenselicense(s) governing use of this skin, e.g. GPL
download下载链接: Use {{Template:WikimediaDownloadSkin }} or {{Github下载 }}.
readme指向readme文件的外部链接
changelog指向changelog文件的外部链接
parametersLocalSettings.php的可用参数
example示例,使用此皮肤的网站或相关截图
compatibility兼容性表格
bugzillaBugzilla MediaWiki skin component name

控制参数

控制参数
参数 描述
templatemodeControls auto-categorisation of host page.

Normally left blank. Alternate values are:

  • nocats - suppresses categorisation. Use this value if you are adding this template to subpages of a skin or to how-to documentation of skins. For example, the usage image above sets templatemode=nocats because this isn't an actual skin page and we don't want to add this page to any categories on account of it.

If this is left blank, this template will add the host page to Category:所有皮肤 and to one or more additional categories, depending on the values assigned to the Content parameters.

subpage; it is not in the Skin: namespace; or if suppressed by 'templatemode=nocats'

Categories added

This template will automatically add the pages it is used on to the Category:All skins category.

In addition, it will categorise the page based on the value of the status parameter:

使用資訊框

現有的皮肤頁面

如果您想将此信息框添加到一个现有的页面,复制并粘贴此页面顶部的代码。

建立新的外觀頁面

如果您想创建一个新的皮肤页面,输入皮肤名到下方并点击按钮。 这将创建一个新页面,其中包含已经导入的信息框模板。

Please replace "TheSkin" with your skin's name:


MediaWiki is an open-source project and users are encouraged to make any MediaWiki skins under an Open Source Initiative (OSI) approved GPLv2 compatible license (including MIT, BSD, PD). For skins that have a compatible license, you can request commit access to the MediaWiki source repository for skins.

A developer sharing their code in the code repository should expect:

Feedback / Criticism / Code reviews
Review and comments by other developers on things like framework use, security, efficiency and usability.
Developer tweaking
Other developers modifying your submission to improve or clean-up your code to meet new framework classes and methods, coding conventions and translations.
Future versions by other developers
New branches of your code being created by other developers as new versions of MediaWiki are released.
Credit
Credit for your work being preserved in future versions
Similarly, you should credit the developers of any skins whose code you borrow from.

Any developer who is uncomfortable with any of these actions occurring should not host their code in the code repository. You are still encouraged to create a summary page for your skin on the wiki to let people know about the skin, and where to download it.

Enhancing this template

If you would like to improve on this template, thanks! This is a complicated template so here is some help along the way:

In addition, Template:Skin/Sample stores the boiler plate that is preloaded into newly created pages and contains some basic documentation on how to fill in the template parameters. It needs to be kept in sync with the documentation.

The Create skin button

To improve the create skin button behavior:

  • Template:Skin/SampleThe boilerplate skin that is preloaded into newly-created pages.
  • Template:Skin/CreateSkinInputBox An input box that can be inserted wherever you want users to easily create skins. For documentation on the ‎<inputbox> tag, please see Extension:输入框 .
  • Skin:TheSkin:Defines a placeholder, in case a user accidentally hits the create button without changing the skin name.

Infobox parameters

In general:

  • To make this template easy to use, each label in the infobox is linked to documentation on the template parameter(s) it displays. If you add a parameter, please be sure to also add it to the content parameter documentation and link its label to that documentation.

To change the behavior of the hook parameters:

Templates used with Template:Foreach can only take one parameter so we need to wrap the call to Template:Extension/HookInUse with another template that sets the mode.

Test cases

See if the following pages are still ok, after editing this template.