Template:Documentation/Wikimedia Commons

From Templates Wiki
Jump to navigation Jump to search
Documentation icon Documentationviewedithistory⧼Code-rev-purge-link⧽

This documentation is transcluded from Template:Documentation/Wikimedia Commons/doc.

Template:TemplateBox

Usage[edit source]

Normally this template is used without any parameters, placed at the bottom of the template or page being documented, within a Template:Tag 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 | 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 | and the | parameter can also be combined, like this:

<!--Last line of your template code--><noinclude>
{{Documentation |1=Template:Any page/doc
| content = {{Template: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:Tnull. In this example a parameter is also fed to the /doc page being loaded.