Help:Templates

Controlling template inclusion
There are 3 tags that can be used in a template to control how certain portions of the text are treated when the template is included.


 * This tag specifies a portion of text that is only displayed when the template is included on another page; it will not be displayed on the template's own page.
 * This tag specifies a portion of text that is only displayed when the template is included on another page; it will not be displayed on the template's own page.


 * This tag specifies a portion of text that is only displayed on the template's own page; it will not be displayed when the template is included on another page.
 * This tag specifies a portion of text that is only displayed on the template's own page; it will not be displayed when the template is included on another page.


 * This tag specifies a portion of text that will be the only content displayed when the template is included on another page; it will also display on the template's own page.
 * This tag specifies a portion of text that will be the only content displayed when the template is included on another page; it will also display on the template's own page.

This can be easier to understand if you think of the tags in pairs.


 * and  are opposites:   is only displayed when the template is included somewhere else, and   is only displayed on the template's page.


 * and  are complementary: wrapping one section of text with   gives the same result as if the other content had been wrapped with.
 * Example:  is identical to

Nesting
The only nesting of these tags that makes sense is to use  inside.

Usage scenarios

 * To auto-categorize all pages that use a template, but not the template itself, use:
 * To display documentation on a template, use:
 * To display in-line comments directly inside a template but hide them from articles, use