Шаблон:ExtensionInstall/doc

Материал из ANT-Inform documentation
Перейти к: навигация, поиск

Шаблон:Timw

Usage

Parameters are optional!

1=
Set the extension name manually (defaults to the current page name without namespace prefix).
download-link=
Overwrite the download link (defaults to linking to ExtensionDistributor with the extension name)
localsettings=
Pass custom php code that the user should include in LocalSettings.php
db-update=
If the extension has one or more database tables that need to be created through update.php, set this parameter to any value (e.g. |db-update=1 or |db-update=Yes).
custom-steps=
Additional steps (as an unordered * list

Examples

Below a few examples of how to use this template:

Simple

{{ExtensionInstall}}
  • Download and extract the files in a directory called "MyExtension" in your extensions/ folder.
  • Add the following code to your LocalSettings.php (at the bottom)
require_once( "$IP/extensions/MyExtension/MyExtension.php" );
  • Файл:Yes check.svg Done – Navigate to Special:Version on your wiki to verify that the extension is successfully installed.

Name

{{ExtensionInstall|CategoryTree}}
  • Download and extract the files in a directory called "CategoryTree" in your extensions/ folder.
  • Add the following code to your LocalSettings.php (at the bottom)
require_once( "$IP/extensions/CategoryTree/CategoryTree.php" );
  • Файл:Yes check.svg Done – Navigate to Special:Version on your wiki to verify that the extension is successfully installed.


Download link

{{ExtensionInstall
|download-link=[http://bits.wikimedia.org/example.zip Download]
}}
  • Download and extract the files in a directory called "MyExtension" in your extensions/ folder.
  • Add the following code to your LocalSettings.php (at the bottom)
require_once( "$IP/extensions/MyExtension/MyExtension.php" );
  • Файл:Yes check.svg Done – Navigate to Special:Version on your wiki to verify that the extension is successfully installed.

LocalSettings

{{ExtensionInstall
|localsettings=
$wgUseAjax = true;
$wgEnableMWSuggest = true;
}}
  • Download and extract the files in a directory called "MyExtension" in your extensions/ folder.
  • Add the following code to your LocalSettings.php (at the bottom)
require_once( "$IP/extensions/MyExtension/MyExtension.php" );
$wgUseAjax = true;
$wgEnableMWSuggest = true;
  • Файл:Yes check.svg Done – Navigate to Special:Version on your wiki to verify that the extension is successfully installed.

DB Update

{{ExtensionInstall
|db-update=Yes
}}
  • Download and extract the files in a directory called "MyExtension" in your extensions/ folder.
  • Add the following code to your LocalSettings.php (at the bottom)
require_once( "$IP/extensions/MyExtension/MyExtension.php" );
  • Run the update script which will automatically create the necessary database tables that this extension needs.
  • Файл:Yes check.svg Done – Navigate to Special:Version on your wiki to verify that the extension is successfully installed.

Custom steps

{{ExtensionInstall
|custom-steps=
* Lorem ipsum dolor sit amet
* Foo bar baz quux [[sandbox]]
}}
  • Download and extract the files in a directory called "MyExtension" in your extensions/ folder.
  • Add the following code to your LocalSettings.php (at the bottom)
require_once( "$IP/extensions/MyExtension/MyExtension.php" );
  • Lorem ipsum dolor sit amet
  • Foo bar baz quux sandbox
  • Файл:Yes check.svg Done – Navigate to Special:Version on your wiki to verify that the extension is successfully installed.

Everything

{{ExtensionInstall|Example
|download-link=[http://bits.wikimedia.org/example.zip Download]
|localsettings=
$wgUseAjax = true;

|db-update=Yes
|custom-steps=
* Lorem ipsum dolor sit amet
* Foo bar baz quux [[sandbox]]
}}
  • Download and extract the files in a directory called "Example" in your extensions/ folder.
  • Add the following code to your LocalSettings.php (at the bottom)
require_once( "$IP/extensions/Example/Example.php" );
$wgUseAjax = true;
  • Run the update script which will automatically create the necessary database tables that this extension needs.
  • Lorem ipsum dolor sit amet
  • Foo bar baz quux sandbox
  • Файл:Yes check.svg Done – Navigate to Special:Version on your wiki to verify that the extension is successfully installed.