The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 2: | Line 2: | ||
This is the {{tl|Documentation}} template, used on almost every template page to contain that template's documented instructions and information. | This is the {{tl|Documentation}} template, used on almost every template page to contain that template's documented instructions and information. | ||
For detailed instructions on how and when to use this template, see [[w:Wikipedia:Template documentation]]. | |||
This template | This template displays a green documentation box like you are seeing now and automatically loads the content from a /doc subpage. It can also load the content from other places if instructed to. | ||
Use of this template allows templates to be [[ | This template is intended for documenting templates and other pages that are [[w:Wikipedia:Transclusion|transcluded]] onto other pages. It can be used in the [[w:Wikipedia:Template namespace|template namespace]] and most other [[w:Wikipedia:Namespace|namespace]]s. | ||
Use of this template allows templates to be [[w:Wikipedia:Protection policy|protected]] where necessary, while allowing anyone to edit the documentation and categories. | |||
===Usage=== | ===Usage=== | ||
Line 14: | Line 16: | ||
<!--Last line of your template code--><noinclude> | <!--Last line of your template code--><noinclude> | ||
{{Documentation}} | {{Documentation}} | ||
<!-- Add categories to the /doc subpage, not here --> | <!-- Add categories to the /doc subpage, interwikis to Wikidata, not here --> | ||
</noinclude> | </noinclude> | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Then this template automatically loads the content from the /doc subpage of the template it is used on | Then this template automatically loads the content from the /doc subpage of the template it is used on. | ||
This template can also load the content from any other page. Like this: | This template can also load the content from any other page. Like this: | ||
Line 52: | Line 54: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Then the pagename fed as parameter 1 is used for the [edit] [purge] links and for the /doc link in the link box below the doc box. But the '''content''' parameter is used for the content shown in the doc box. The above code means that the content is transcluded as {{tlx|Any page/doc | Then the pagename fed as parameter 1 is used for the [edit] [purge] links and for the /doc link in the link box below the doc box. But the '''content''' parameter is used for the content shown in the doc box. The above code means that the content is transcluded as {{tlx|Template:Any page/doc{{!}}parameters}}. In this example a parameter is also fed to the /doc page being loaded. | ||
=== Shortcut === | === Shortcut === | ||
Line 137: | Line 139: | ||
* [[w:Wikipedia:Template documentation]] is a how-to guide to template documentation. | * [[w:Wikipedia:Template documentation]] is a how-to guide to template documentation. | ||
* [[w:Wikipedia:Template sandbox and test cases]] explains the use of /sandbox and /testcases subpages and includes more information about template testing. | * [[w:Wikipedia:Template sandbox and test cases]] explains the use of /sandbox and /testcases subpages and includes more information about template testing. | ||