Extension:TemplateSandbox
From Linux Web Expert
- This is technical documentation of the extension. There is also a user documentation.
TemplateSandbox Release status: stable |
|
---|---|
File:Screenshot of TemplateSandbox.png | |
Implementation | Special page , Page action |
Description | Preview pages using sandboxed templates |
Author(s) | Brad Jorsch (Anomietalk) |
Latest version | 1.1.0 (continuous updates) |
Compatibility policy | Snapshots releases along with MediaWiki. Master is not backward compatible. |
MediaWiki | 1.35+ |
PHP | 7.0+ |
License | GNU General Public License 2.0 or later |
Download | |
Help | Help:Extension:TemplateSandbox |
|
|
Quarterly downloads | Lua error in Module:Extension at line 172: bad argument #1 to 'inNamespace' (unrecognized namespace name 'skin'). |
Public wikis using | Lua error in Module:Extension at line 172: bad argument #1 to 'inNamespace' (unrecognized namespace name 'skin'). |
Translate the TemplateSandbox extension if it is available at translatewiki.net | |
Issues | Open tasks · Report a bug |
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.
Installation
- <translate> [[<tvar name=2>Special:ExtensionDistributor/TemplateSandbox</tvar>|Download]] and move the extracted <tvar name=name>
TemplateSandbox
</tvar> folder to your <tvar name=ext>extensions/
</tvar> directory.</translate>
<translate> Developers and code contributors should install the extension [[<tvar name=git>Special:MyLanguage/Download from Git</tvar>|from Git]] instead, using:</translate>cd extensions/
git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/TemplateSandbox - <translate> Add the following code at the bottom of your <tvar name=1>LocalSettings.php </tvar> file:</translate>
wfLoadExtension( 'TemplateSandbox' );
- File:OOjs UI icon check-constructive.svg <translate> Done</translate> – <translate> Navigate to <tvar name=special>Special:Version</tvar> on your wiki to verify that the extension is successfully installed.</translate>
Configuration
- Parameters
$wgTemplateSandboxEditNamespaces
- Namespaces in which to show the "Preview page with this template" box below the edit form.NS_TEMPLATE
by default. Can be expanded to all namespaces by individual users using advancedtemplatesandbox.js.
Usage
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:Foo
toUser:Example/sandbox/Template:Foo
. Alternatively, you might createUser:Example/sandbox/Template:Foo
as 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.
The box can be forced to appear in the edit form for any page by adding the query parameter wpTemplateSandboxShow
to the URL.
See also
- User:Jackmcbarn/advancedtemplatesandbox.js — A MediaWiki user script that enables use of TemplateSandbox for all pages.
- Help:ExpandTemplates
- Extension:SandboxLink
- Extension:Scribunto − This extension also allows for sandboxing Scribunto modules.
File:Wikimedia-logo black.svg | <translate> This {{<tvar name=1>#ifeq:Extension|Extension</tvar>|extension|skin}} is being used on one or more [[<tvar name=2>m:Special:MyLanguage/Wikimedia projects</tvar>|Wikimedia projects]].</translate> <translate> This probably means that the {{<tvar name=1>#ifeq:Extension|Extension</tvar>|extension|skin}} is stable and works well enough to be used by such high-traffic websites.</translate> <translate> Look for this {{<tvar name=1>#ifeq:Extension|Extension</tvar>|extension's|skin's}} name in Wikimedia's <tvar name=2>CommonSettings.php</tvar> and <tvar name=3>InitialiseSettings.php</tvar> configuration files to see where it's installed.</translate> <translate> A full list of the {{<tvar name=1>#ifeq:Extension|Extension</tvar>|extensions|skins}} installed on a particular wiki can be seen on the wiki's <tvar name=ver>Special:Version</tvar> page.</translate> |
Screenshot of TemplateSandbox.png |
Categories:
- Pages with script errors
- Pages with broken file links
- Stable extensions
- Special page extensions
- Page action extensions
- Extensions with release branches compatibility policy
- Extensions with manual MediaWiki version
- GPL licensed extensions
- Extensions in Wikimedia version control
- APIGetAllowedParams extensions
- AlternateEditPreview extensions
- ApiMakeParserOptions extensions
- All extensions
- Extensions used on Wikimedia