Template:Documentation

From Dharmawiki
Revision as of 14:58, 30 June 2016 by WikiSysop (talk | contribs) (1 revision imported)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
50px Template documentation[view] [edit] [history] [purge]

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.