Difference between revisions of "Template:Documentation"
m (1 revision imported) |
(No difference)
|
Revision as of 14:58, 30 June 2016
Lua error: expandTemplate: invalid title "Template:TemplateBox/i18n/Template:Fallback".
Usage
Normally this template is used without any parameters, placed at the bottom of the template or page being documented, within a <noinclude>...</noinclude>
container:
<!--Last line of your template code--><noinclude> {{Documentation}} <!-- Add categories to the /doc subpage --> </noinclude>
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:
<!--Last line of your template code--><noinclude> {{Documentation |Template:Other page/doc}} </noinclude>
Note that when loading the documentation from a page other than the local /doc page it becomes tricky to handle the categories.
The content can also be fed directly as text. Like this:
<!--Last line of your template code--><noinclude> {{Documentation | content = (some documentation) }}</noinclude>
When the |content=
parameter is used, the doc box normally does not show the [edit] [purge] links in the top right corner. Note that if the /doc page exists, a link to it is still shown in the link box below the doc box.
Parameter |1=
and the |content=
parameter can also be combined, like this:
<!--Last line of your template code--><noinclude> {{Documentation |1=Template:Any page/doc | content = {{Any page/doc |parameters}} }}</noinclude>
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 {{Template:Any page/doc|parameters}}
. In this example a parameter is also fed to the /doc page being loaded.
The above documentation is transcluded from Template:Documentation/doc. (edit | history) Editors can experiment in this template's sandbox (create | mirror) and testcases (create) pages. Please add categories to the /doc subpage. Subpages of this template. |