Wikipedia:Template sandbox and test cases: Difference between revisions
Content deleted Content added
Undid revision 727134661 by 188.48.113.148 (talk) |
Thought I'd add the ___location of the sandbox links and alternative sandboxes, as when I came here, I really was unable to work out where I should be editing. Hope the little extra information helps newbies figure it out! |
||
Line 1:
{{Wikipedia how to|WP:TEMPTEST|WP:TESTCASE|WP:TESTCASES}}
[[Help:Template|Templates]] are a very powerful feature of [[MediaWiki]], but mistakes can be easily made, even by experienced users. Complex templates should therefore be accompanied by [[Sandbox (software development)|sandboxes]] and [[test case]]s to prevent bugs. Experimentation may also be carried out in the temporary sandboxes [[Template:X1|X1]]-[[Template:X20|X20]] or the [[Template:Template_sandbox|Template Sandbox]].
== Sandbox and testcases subpage naming ==
Most protected templates already have a sandbox subpage and testcases subpage. The names of these pages are default.
For example, here are the subpages for '''{{tl|FlagIOCmedalist}}''':
Line 18:
|}
==
It is highly recommended to apply the test case pattern to templates using [[mw:Help:Extension:ParserFunctions|ParserFunctions]] that can generate very different looking output, such as
For navigational boxes
== How to create /sandbox and /testcases subpages ==
# Suppose your template is named <code>Template:X</code>. Create a subpage with the name <code>Template:X/sandbox</code>. If the main template is using the {{tl|documentation}} template, you can do this from a link at the bottom of the blue documentation box on the template main page. Or you can type it into the search box, or directly into the URL bar of your browser. Note that "/sandbox" is all lowercase.
# Copy the entire contents of the main template, including <code><nowiki><noinclude></nowiki></code> tags and the {{tl|documentation}} template if present, paste it into the edit window of the /sandbox subpage, and save the page. Your edit summary should be something like "create sandbox version of [[Template:X]]".
#* Note: if you use the "mirror" link at the bottom of the blue documentation box, tags like <code><nowiki><noinclude></nowiki></code>, and their contents, will be missing. It's best just to copy and paste manually.
|