Extension:TemplateSandbox
From MediaWiki.org
- This is technical documentation of the extension. There is also a user documentation
|
TemplateSandbox Release status: stable |
|||
|---|---|---|---|
| Implementation | Special page, Page action | ||
| Description | Preview pages using sandboxed templates | ||
| Author(s) | Brad Jorsch (Anomietalk) | ||
| Last version | 1.0.0 (2012-11-08) | ||
| MediaWiki | 1.21+ | ||
| PHP | 5.3+ | ||
| Database changes | no | ||
| License | GPL v2+ | ||
| Download | |||
|
|||
|
|||
| Check usage and version matrix | |||
| Bugs: list open list all report | |||
The TemplateSandbox extension adds the ability to preview a page using sandboxed versions of templates, allowing for easy testing before making the sandbox code live. It also works with Scribunto modules.
Contents |
Installation [edit]
- Download and extract the files in a directory called "
TemplateSandbox" in your extensions/ folder. - Add the following code to your LocalSettings.php (at the bottom)
require_once( "$IP/extensions/TemplateSandbox/TemplateSandbox.php" );
Done – Navigate to "Special:Version" on your wiki to verify that the extension is successfully installed.
Configuration [edit]
- Parameters
$wgTemplateSandboxEditNamespaces: Namespaces in which to show the "Preview page with this template" box below the edit form. NS_TEMPLATE by default.
Usage [edit]
The extension adds a new special page, Special:TemplateSandbox. To preview a page using sandboxed templates, do the following:
- Copy the templates to be tested under a common prefix. For example, you might copy
Template:FootoUser:Example/sandbox/Template:Foo. Alternatively, you might createUser:Example/sandbox/Template:Fooas a redirect toTemplate:Foo/sandbox. - Go to Special:TemplateSandbox. Fill in the page or revision to be rendered, and the prefix you chose in step 1. It is possible to specify multiple prefixes (a prefix search path) by separating them using vertical bars, e.g.
User:Example/sandbox1|User:Example/sandbox2. - Click View.
The extension also adds a box at the bottom of the edit form for pages in the namespaces configured in $wgTemplateSandboxEditNamespaces. This allows for previewing some other page as it would appear were the template being edited saved with the current contents of the edit form.
See also [edit]
- Extension:ExpandTemplates
- Extension:Scribunto − This extension also allows for sandboxing Scribunto modules.
| This extension is being used on one or more Wikimedia projects. This probably means that the extension is stable and works well enough to be used by such high-traffic websites. Look for this extension's name in Wikimedia's CommonSettings.php and InitialiseSettings.php configuration files to see where it's installed. A full list of the extensions installed on a particular wiki can be seen on the wiki's Special:Version page. |

