Movatterモバイル変換


[0]ホーム

URL:


Jump to content
MediaWiki
Search

Extension:TemplateSandbox

From mediawiki.org
Translate this page
Languages:
This is technical documentation of the extension. There is alsouser documentation.
MediaWiki extensions manual
TemplateSandbox
Release status: stable
ImplementationSpecial page,Page action
DescriptionPreview pages using sandboxed templates
Author(s)Brad Jorsch (Anomietalk)
Latest version1.1.0 (continuous updates)
Compatibility policySnapshots releases along with MediaWiki. Master is not backward compatible.
LicenseGNU General Public License 2.0 or later
Download
HelpHelp:Extension:TemplateSandbox
  • $wgTemplateSandboxEditNamespaces
Translate the TemplateSandbox extension if it is available at translatewiki.net
IssuesOpen tasks ·Report a bug

TheTemplateSandbox 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 withScribunto modules.

Installation

[edit]
  • Download and move the extractedTemplateSandbox folder to yourextensions/ directory.
    Developers and code contributors should install the extensionfrom Git instead, using:
    cdextensions/gitclonehttps://gerrit.wikimedia.org/r/mediawiki/extensions/TemplateSandbox
  • Add the following code at the bottom of yourLocalSettings.php file:
    wfLoadExtension('TemplateSandbox');
  • Configure as required.
  • YesDone – Navigate toSpecial: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. Can be expanded to all namespaces by individual users usingadvancedtemplatesandbox.js.


Usage

[edit]

The extension adds a new special page,Special:TemplateSandbox.To preview a page using sandboxed templates, do the following:

  1. Copy the templates to be tested under a common prefix. For example, you might copyTemplate:Foo toUser:Example/sandbox/Template:Foo. Alternatively, you might createUser:Example/sandbox/Template:Foo as a redirect toTemplate:Foo/sandbox.
  2. Go toSpecial: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 (aprefix search path) by separating them using vertical bars, e.g.,User:Example/sandbox1|User:Example/sandbox2.
  3. ClickView.

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 parameterwpTemplateSandboxShow to the URL.


See also

[edit]
This extension is being used on one or moreWikimedia 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'sCommonSettings.php andInitialiseSettings.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'sSpecial:Version page.
This extension is included in the following wiki farms/hosts and/or packages:This is not an authoritative list. Some wiki farms/hosts and/or packages may contain this extension even if they are not listed here. Always check with your wiki farms/hosts or bundle to confirm.
Retrieved from "https://www.mediawiki.org/w/index.php?title=Extension:TemplateSandbox&oldid=7928453"
Categories:
Hidden category:

[8]ページ先頭

©2009-2025 Movatter.jp