Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

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:


<syntaxhighlight lang="xml+smarty">
<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>
</syntaxhighlight>
</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:


<syntaxhighlight lang="xml+smarty">
<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>
</syntaxhighlight>
</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:


<syntaxhighlight lang="xml+smarty">
<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>
</syntaxhighlight>
</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:


<syntaxhighlight lang="xml+smarty">
<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>
</syntaxhighlight>
</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.
Please note that all contributions to skyHow are considered to be released under the Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) (see skyHow:Copyrights for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource. Do not submit copyrighted work without permission!
Cancel Editing help (opens in new window)