Extension:TemplateSandbox/cs
- Toto je technická dokumentace rozšíření. There is also user documentation.
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
- Stáhněte soubor/y a vložte je do adresáře pojmenovaného
TemplateSandbox
ve vaší složceextensions/
.
Vývojáři a přispěvatelé kódu by si místo toho měli nainstalovat rozšíření from Git pomocí:cd extensions/
git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/TemplateSandbox - Na konec vašeho souboru LocalSettings.php přidejte následující kód:
wfLoadExtension( 'TemplateSandbox' );
- Configure as required.
Dokončeno – Přejděte na stránku Special:Version vaší wiki a zkontrolujte, zda bylo rozšíření úspěšně nainstalováno.
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 user script that enables use of TemplateSandbox for all pages.
- Nápověda:ExpandTemplates
- Extension:SandboxLink
- Rozšíření:Scribunto − This extension also allows for sandboxing Scribunto modules.
![]() | Toto rozšíření se používá na jednom nebo více projektech Wikimedia. Pravděpodobně to znamená, že rozšíření je stabilní a funguje dostatečně dobře, aby jej mohly používat weby s tak vysokou návštěvností. Vyhledejte tento název rozšíření v konfiguračních souborech CommonSettings.php a InitialiseSettings.php Wikimedie, abyste viděli, kde je nainstalováno. Úplný seznam rozšíření nainstalovaných na konkrétní wiki lze vidět na stránce wiki Special:Version. |
![]() | Toto rozšíření je zahrnuto v následujících wiki farmách/hostitelích a/nebo balíčcích: Toto není autoritativní seznam. Některé wiki farmy/hostitelé a/nebo balíčky mohou toto rozšíření obsahovat, i když zde nejsou uvedeny. Pro potvrzení se vždy obraťte na své wiki farmy/hostitele nebo balíček. |