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 11: | Line 11: | ||
Normally this template is used without any parameters, placed at the bottom of the template or page being documented, within a <noinclude> container: | Normally this template is used without any parameters, placed at the bottom of the template or page being documented, within a <noinclude> container: | ||
< | <source lang="xml+smarty"> | ||
<!--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, not here --> | ||
</noinclude> | </noinclude> | ||
</ | </source> | ||
Then this template automatically loads the content from the /doc subpage of the template it is used on, along with automatically transcluding {{tl|How to export}}. To hide the instructions from {{tl|How to export}}, set the parameter <code>noexportinstructions</code> to <code>yes</code> | Then this template automatically loads the content from the /doc subpage of the template it is used on, along with automatically transcluding {{tl|How to export}}. To hide the instructions from {{tl|How to export}}, set the parameter <code>noexportinstructions</code> to <code>yes</code> | ||
Line 22: | Line 22: | ||
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: | ||
< | <source lang="xml+smarty"> | ||
<!--Last line of your template code--><noinclude> | <!--Last line of your template code--><noinclude> | ||
{{Documentation |Template:Other page/doc}} | {{Documentation |Template:Other page/doc}} | ||
</noinclude> | </noinclude> | ||
</ | </source> | ||
Note that when loading the documentation from a page other than the local /doc page it becomes tricky to handle the categories. | Note that when loading the documentation from a page other than the local /doc page it becomes tricky to handle the categories. | ||
Line 32: | Line 32: | ||
The content can also be fed directly as text. Like this: | The content can also be fed directly as text. Like this: | ||
< | <source lang="xml+smarty"> | ||
<!--Last line of your template code--><noinclude> | <!--Last line of your template code--><noinclude> | ||
{{Documentation | {{Documentation | ||
Line 38: | Line 38: | ||
(some documentation) | (some documentation) | ||
}}</noinclude> | }}</noinclude> | ||
</ | </source> | ||
When the <nowiki>|content=</nowiki> 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. | When the <nowiki>|content=</nowiki> 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. | ||
Line 44: | Line 44: | ||
Parameter <nowiki>|1=</nowiki> and the <nowiki>|content=</nowiki> parameter can also be combined, like this: | Parameter <nowiki>|1=</nowiki> and the <nowiki>|content=</nowiki> parameter can also be combined, like this: | ||
< | <source lang="xml+smarty"> | ||
<!--Last line of your template code--><noinclude> | <!--Last line of your template code--><noinclude> | ||
{{Documentation |1=Template:Any page/doc | {{Documentation |1=Template:Any page/doc | ||
Line 50: | Line 50: | ||
{{Template:Any page/doc |parameters}} | {{Template:Any page/doc |parameters}} | ||
}}</noinclude> | }}</noinclude> | ||
</ | </source> | ||
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|parameters}}. In this example a parameter is also fed to the /doc page being loaded. | 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|parameters}}. In this example a parameter is also fed to the /doc page being loaded. |