Template:Template sandbox notice/doc

This is the template sandbox notice template.

It can be placed on template /sandbox pages. It also detects when it is not on a /sandbox page and then shows nothing, thus it can be left in the code when copied and pasted to the main template. (Although most users remove the sandbox notice when they copy the code from the /sandbox to the main template. But beware, if the notice-not-sandbox parameter has been used then the sandbox notice must be copied with the rest of the template code. See more below.)

To learn more about how to use template /sandbox and /testcases subpages see Template test cases.

Simple example
&lt;noinclude&gt;

&lt;/noinclude&gt;

Note! The template code must start directly before and physically touch the  tag. Any blank space or newlines between the template code and the  tag can cause the template to render unwanted spaces or newlines when used.

Non-standard "/sandbox" names
If the /sandbox page has another name, for instance is spelled with an upper-case S like in "/Sandbox", then you need to tell the sandbox notice the name of the page. So it knows when to show and not show itself. Like this:

&lt;noinclude&gt;

&lt;/noinclude&gt;

Another option is of course to move the sandbox page to the standard "/sandbox" name. That is good since other templates and tools also assume that the sandbox uses that name. For instance documentation assumes that.

Showing and hiding other things
The sandbox notice can also help showing and hiding other things depending on if it detects it is on the /sandbox page or not. Like this:

&lt;noinclude&gt;

&lt;/noinclude&gt;

Protection template example
The notice-not-sandbox parameter can for instance be used so a protection template can be placed already in the /sandbox version of the code. (See also Protection policy.) Like this:

&lt;noinclude&gt;

&lt;/noinclude&gt;

Documentation example
Some templates have their documentation on a separate /doc page, and then show that documentation in a green doc box below the template code by using the documentation template. (See also Template documentation.) Then place the sandbox notice like this:

&lt;noinclude&gt;

&lt;/noinclude&gt;

Super deluxe example
This example handles both a protection template and a green doc box from a /doc page at the same time. (See also Protection policy and Template documentation.) Like this:

&lt;noinclude&gt;

&lt;/noinclude&gt;

Copy, paste & delete
The following "complete" example can be used to copy and paste into your template, then delete the parts you don't need:

&lt;noinclude&gt;

&lt;/noinclude&gt;

Technical details
If there is an accompanying "/testcases" page this template will detect that and show a link to the /testcases page.

This template categorises /sandbox pages into Category:Template sandboxes. If you don't want a page to be categorised then use the template like this:

If you want to demonstrate the template on say Template messages/Template namespace then you need to feed the subpage-name to make it show and feed an empty category parameter so it doesn't categorise the page. Like this: