Template:Extension/zh

  {{Documentation|content= {{intricate template}} {{lua|Module:Extension|Module:ExtensionJson|Module:String}} {{Uses TemplateStyles|Template:Infobox/styles.css|Template:Extension/styles.css|Template:Extension/status.css}} 此模板應當加入到此wiki上的所有擴充功能的頁面上（僅主頁面）. 此模板會加入一個很有用的資訊框（見下方）且會自動將擴充功能加入到{{ll|Category:All extensions}}，以及相應的{{ll|Category:Extensions by status|狀態}}與{{ll|Category:Extensions by implementation type|實現類型}}的分類裡面.

{{Clear}}

用法


内容参数
此段描述控制資訊框內容的參數. 關於templatemode和其他的控制參數，見控制參數. 其他的'type'值均为无效，会导致扩展页面处于Category:Extensions with invalid or missing type分类中.
 *  - 自定义有参数的类模板标记，如
 *  - 自定义类XML标签标记，如
 *  - 自定义无参数的类模板标记，如
 *  - 适用于添加非标准wiki语法的扩展（即添加的语法 不属于 标签、解析器函数、变量）.
 * - 适用于所有，也就是创建、验证、授予/撤销权限或监视用户活动的扩展. 如果您编写的是用户访问类型的扩展，请使用以下更具体的类型：
 * - 监视用户活动（登录、退出、新用户创建等）的扩展
 * - 创建、删除用户，和（或）验证用户身份的扩展
 * - 权限管理系统扩展，如更改权限分配方式、API、维护工具（不包括仅仅为扩展功能添加权限的扩展；相关用途要使用权限参数）
 * - 适用于所有未分类的用户界面扩展.
 *  - 通过注册文件扩展名，使得能在wiki页面上嵌入特定多媒体内容的扩展.
 *  - 提供基础设施以便用户个性化MediaWiki使用体验和（或）帮助管理该基础设施的扩展.
 * - 给用户发送电子邮件、广播消息、提供其他形式社区通知的扩展.
 *  - 加强或修改s的扩展. 包括所有实现了读取、写入、搜索、创建、重命名、删除、重定向、讨论页面的操作的扩展. 不包括相关权限（使用user rights）或日志（使用user activity）.
 * - 为用户搜索和选择页面的扩展.
 * - 添加CSS或JavaScript或通过皮肤框架，实现钩子函数来更改MediaWiki外观的扩展.
 * - 使用Ajax技术的扩展.
 * - 实现类的子类、使用其钩子、修改中一个或多个函数的扩展. 更多参见.
 * other
 * - 添加了新API模块或扩展核心API模块的扩展.
 * - 钩子函数 - 定义一个 新的 钩子 - 若想定义为扩展 使用 的钩子，见下方hook1等
 * - 将表格和（或）字段添加到支持MediaWiki安装的数据库
 * - 取出-{zh-hans:数据; zh-hant:資料;}-
 * - 添加新的文件存储库作为文件后端的扩展
 * - 不是真的扩展，而是作为如何编写扩展的示例
 * - 有新的扩展.
 * - 对底层编程语言的扩展.
 * - 与本地化有关的扩展
 * - 与本地化有关的扩展

注：许多扩展都有多于一个的类型，如果这也适用于您编写的扩展，将 替换为. 每个扩展最多可以被分到6个类型. hook1 hook2 hook3 hook4 ... 此扩展使用的所有钩子的名字 在此字段添加值有助于扩展开放，帮助其他开发者. 每个有文档的钩子会自动将扩展添加到使用相应钩子的扩展的分类. 此分类会自动链接到每个钩子页面，程序员可以借此轻松找到某扩展使用的某钩子的示例.

内置钩子：
 * 直接写钩子名. 值参见（请省略前导'/'）.

扩展定义的自定义钩子：
 * 使用extensionName/hookName. 关于自定义钩子的列表（不完全），见Extension hook registry.

有多个钩子时，第一个钩子写到hook1，第二个写到hook2，以此类推. newhook1 newhook2 newhook3 newhook4 ... newhook90  此扩展提供的所有钩子的名字

您可能也想向Extension hook registry添加钩子. username  作者在MediaWiki.org上的用户名（若有）. 可以省略，但若存在，则会自动链接到作者的用户页和用户讨论页. 请不要写命名空间或. 扩展的作者名，如果和MediaWiki.org上的不同. 任意文字. 若省略，则使用“username”字段（若有值）. description  简短描述 扩展的Logo或截图. 请不要写命名空间或. 可选，图片大小（默认220px） 最后版本 上次更新日期 compatibility policy  （允许的值有master、rel、ltsrel） 需要使用的MediaWiki版本. Most extensions should not need to use this — it defaults to the value of the property of. See also Category:Extensions without MediaWiki version and Category:Extensions with manual MediaWiki version. 需要使用的PHP版本 表示只有完成扩展更改数据库表架构或类似操作，MediaWiki才能运行. 这是一个常见的陷阱：如果您忘记运行update.php（如果扩展需要），MediaWiki将会出错. 若无，也请设置 ，因为这可以确保扩展不需要运行update.php，从而避免不确定性

Extensions which conform to MediaWiki extension standards come with a schema change script which you need to start manually (once) before starting and accessing the MediaWiki through your browser, and after you copied all the extension files to  and inserted   into "LocalSettings.php", run from the command line:

composer  The extension's Composer package name, in the standard format. It will be automatically included if set in an extension's "composer.json" file (i.e. this parameter is not required in that case). It will be linked to the extension's page on Packagist. table1 table2 table3 table4 ... table30 name of each non-core table used by the extension

Links to a subpage of your extension page. For instance, "table1 = cu_changes" at will link to. Don't list core tables such as or ; only list tables that are added by extensions. license governing use of this extension, as one of the codes found in https://spdx.org/licenses/, e.g.,   or  , etc. download  下載連結： Git 、 WikimediaDownload. repo  Name of the Gerrit repository the extension's code is stored in, if different from the page name. Setting this automatically sets download, and allows the template to automatically load data from the appropriate  file. external link to the readme file, e.g. https://phabricator.wikimedia.org/r/browse/mediawiki/extensions/Flow;master;README external link to the changelog file, e.g. Extension:XGlossary/Changelog available parameters for LocalSettings.php any tags your extension uses (e.g. &lt;tag1&gt;, &lt;tag2&gt;). rights added by the extension. Not to be confused with the license! Rights are such as ' or ', not such as GFDL or LGPL or GPL - those are licenses! namespace in which this extension is used Link to user-help for the extension. If not provided, will look for. If provided, full wikitext link should be given (because you may want to link to e.g. an external page). example, website or screenshot of working extension Additional compatibility information, for instance compatibility charts. It's encouraged to add any client-side compatibility information here too, especially when diverging from expectations of full support for a browser. Optional parameter to link the exact page where (message group id with which) the extension will be translatable on translatewiki.net if enabled. If the default link is incorrect, manually set it to: Bugzilla MediaWiki extension component name Phabricator project name override the page name used for the check usage link.
 * ext-LOWERCASE(NOSPACES(Label as defined in )), aka
 * the parameter you get in the URL after
 * typing the name of the extension in the search/filter box at translatewiki:Special:Translate or
 * searching for its name in languagestats after clicking "expand all".



控制参数
because this isn't an actual extension page and we don't want to add this page to any categories on account of it.
 * nousage - suppresses the 'check usage' link. Link is also suppressed if the page is a subpage; it is not in the Extension: namespace; or if suppressed by 'templatemode=nocats'

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



使用資訊框


現有的擴充功能頁面
If you want to add the infobox to an existing page, copy and paste the code at the top of this page.



建立新的擴充功能頁面
If you want to create a new extension page, enter the name below and click the button. A new page will be created with the infobox template already in place.



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



创建扩展按钮
To improve the create extension button behavior:


 * : The boilerplate extension that is preloaded into newly-created pages.
 * : An input box that can be inserted wherever you want users to easily create extensions. For documentation on the tag, please see.



資訊框參數
一般情況下：


 * 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/correct/add to the implementation type parameters:
 * Check the talk page - there have been some extensive discussions about this field.
 * The valid types and what they link to are defined at Module:Extension

To change the behavior of the hook parameters:


 * Template:Extension/HookInUse: Adds links and categories for a hook in use. Multiple hooks in use are implemented by calling this template with Template:Foreach.
 * Template:Extension/HookInUseNoCats: Used instead of Template:Extension/HookInUse when this template is used in . 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.

<span id="Test_case">

测试样例
编辑此模板后，请查看以下页面是否正常.
 * Extension:Description2
 * Template:Extension

}} Maintenance: vulnerabilities, archived