zh
<languages />
- 下载文件,并将其放置在您
extensions/
文件夹中的ExtensionInstall
目录内。 - 将下列代码放置在您的LocalSettings.php的底部:
require_once "$IP/extensions/ExtensionInstall/ExtensionInstall.php";
- {{ Template:TNTN }} - 在您的wiki上导航至Special:Version,以验证扩展已成功安装。
{{ Template:TNTN |content=
Contents
Usage
<templatedata> { "description": "Add instructions about installing an extension.", "params": { "1": { "label": "Extension name", "description": "Set the extension name manually.", "default": "The current page name without namespace prefix." }, "vagrant": { "label": "Vagrant role name", "description": "If given, shows how to install extension with the vagrant's enable-role command" }, "download-link": { "label": "Download link", "description": "Overwrite the download link.", "default": "Link to ExtensionDistributor with the extension name." }, "localsettings": { "label": "LocalSettings", "description": "Pass custom php code that the user should include in LocalSettings.php." }, "db-update": { "label": "Database update.", "description": "If the extension has one or more database tables that need to be created through update.php, set this parameter to any value." }, "custom-steps0": { "label": "Custom steps 0", "description": "Additional steps before download, e.g. other required extensions (as an unordered \"* list\")" }, "custom-steps": { "label": "Custom steps", "description": "Additional steps (as an unordered \"* list\")" }, "registration": { "label": "If the extension supports extension registration", "description": "Changes the template to use wfLoadExtension if it supports registration", "type": "boolean" } }, "format": "inline" } </templatedata>
Examples
Below a few examples of how to use this template:
Simple
{{TNT|ExtensionInstall}}
{{ Template:TNTN |MyExtension}}
Name
{{TNT|ExtensionInstall|CategoryTree}}
{{ Template:TNTN |CategoryTree}}
Download link
{{TNT|ExtensionInstall |download-link=[http://bits.wikimedia.org/example.zip Download] }}
{{ Template:TNTN |MyExtension |download-link=Download }}
LocalSettings
{{TNT|ExtensionInstall |localsettings= $wgUseAjax = true; }}
{{ Template:TNTN |MyExtension |localsettings= $wgUseAjax = true; }}
DB Update
{{TNT|ExtensionInstall |db-update=Yes }}
{{ Template:TNTN |MyExtension |db-update=Yes }}
Custom steps
{{TNT|ExtensionInstall |custom-steps= * Lorem ipsum dolor sit amet * Foo bar baz quux [[sandbox]] }}
{{ Template:TNTN |MyExtension |custom-steps=
- Lorem ipsum dolor sit amet
- Foo bar baz quux sandbox
}}
Support registration
{{TNT|ExtensionInstall |registration=1 }}
{{ Template:TNTN |MyExtension |registration=1 }}
Require registration
{{TNT|ExtensionInstall |registration=required }}
{{ Template:TNTN |MyExtension |registration=required }}
Everything
{{TNT|ExtensionInstall|Example |download-link=[http://bits.wikimedia.org/example.zip Download] |vagrant=example |localsettings= $wgUseAjax = true; |db-update=Yes |custom-steps= * Lorem ipsum dolor sit amet * Foo bar baz quux [[sandbox]] |registration=yes }}
{{ Template:TNTN |Example |download-link=Download |vagrant=example |localsettings= $wgUseAjax = true;
|db-update=Yes |custom-steps=
- Lorem ipsum dolor sit amet
- Foo bar baz quux sandbox
|registration=yes }}
}} [[Category:TemplatesTemplate:Translation]]