Help:Template previews
More actions
Shared templates and Lua modules can affect many articles. TemplateSandbox lets you preview a real article with proposed code before changing the live shared component. Existing edit and page-creation permissions still apply; a preview does not publish or grant approval.
Preview an unsaved template edit
- Open the shared template in the source editor and change its code.
- Find “Preview page with this template” below the editor and enter an article that uses it.
- Use that preview button and check the article’s output, including default/missing parameters, categories and mobile layout.
- Save the shared template only when the preview is satisfactory.
The preview field is enabled on Template and Module pages. For Lua, test through a page that invokes the module. Check existing usage before changing a shared component. Individual and cascading page protection still apply.
Preview sandbox copies together
Use Special:TemplateSandbox when testing several templates or modules together. For a prefix User:Example/sandbox, copies retain their original namespace inside the prefix:
Template:Character Panel→User:Example/sandbox/Template:Character PanelModule:Document status→User:Example/sandbox/Module:Document status
Enter the article to preview and that prefix on the special page. Only copies actually present under the prefix override live components. Ordinary Template:Name/sandbox pages can also be used through prefix-page redirects as described in the upstream documentation. Creating or saving a sandbox copy is a normal edit and requires the appropriate permissions; the special-page preview does not save the target article.
TemplateStyles code is separate from template/Lua previewing. Preview changed styles and verify them on desktop/mobile before publishing; do not assume a template preview replaces that check.
See Echoes of the Flesh:Templates, Echoes of the Flesh:Access levels and MediaWiki’s TemplateSandbox guide.