Extension:TemplateSandbox
- これは、拡張機能の技術的な文書です。 ユーザードキュメントもあります。
![]() リリースの状態: 安定 |
|
---|---|
![]() |
|
実装 | 特別ページ , ページの操作 |
説明 | サンドボックス化されたTemplateを使ってページをプレビューする |
作者 | Brad Jorsch (Anomieトーク) |
最新バージョン | 1.1.0 (continuous updates) |
互換性の方針 | MediaWikiとともにリリースされるスナップショット。 master には後方互換性がありません。 |
MediaWiki | 1.35+ |
PHP | 7.0+ |
ライセンス | GNU 一般公衆利用許諾書 2.0 以降 |
ダウンロード | |
ヘルプ | Help:Extension:TemplateSandbox/ja |
|
|
Quarterly downloads | 70 (Ranked 113rd) |
Public wikis using | 1,213 (Ranked 194th) |
translatewiki.net で翻訳を利用できる場合は、TemplateSandbox 拡張機能の翻訳にご協力ください | |
問題点 | 未解決のタスク · バグを報告 |
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.
インストール
- ダウンロードして、ファイルを
extensions/
フォルダー内のTemplateSandbox
という名前のディレクトリ内に配置します。 - 以下のコードを
LocalSettings.php
の末尾に追加します:wfLoadExtension( 'TemplateSandbox' );
- 完了 – ウィキの「Special:Version」に移動して、拡張機能が正しくインストールされたことを確認します。
MediaWiki 1.24以前を稼働させている利用者へ:
上記の手順では、wfLoadExtension()
を使用してこの拡張機能をインストールする新しい方法を記載しています。
この拡張機能をこれらの過去のバージョン (MediaWiki 1.24以前) にインストールする必要がある場合は、wfLoadExtension( 'TemplateSandbox' );
の代わりに以下を使用する必要があります:
require_once "$IP/extensions/TemplateSandbox/TemplateSandbox.php";
設定
- パラメーター
$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.
使用法
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.
関連項目
- User:Jackmcbarn/advancedtemplatesandbox.js — A MediaWiki user script that enables use of TemplateSandbox for all pages.
- Help:テンプレート展開
- Extension:SandboxLink
- Extension:Scribunto − This extension also allows for sandboxing Scribunto modules.
この拡張機能は 1 つ以上のウィキメディアのプロジェクトで使用されています。 これはおそらく、この拡張機能が安定していて高いトラフィックのウェブサイトでも十分に動作することを意味します。 この拡張機能がインストールされている場所を確認するには、ウィキメディアの設定ファイル CommonSettings.php および InitialiseSettings.php 内で、この拡張機能の名前を探してください。 特定のウィキにインストールされている拡張機能の完全な一覧は、そのウィキの Special:Version ページにあります。 |
この拡張機能は以下のパッケージ/ウィキファームに含まれています: This is not an authoritative list. Some wiki farms/hosts may contain this extension even if they are not listed here. Always check with your wiki farms/hosts or bundle to confirm. |