5,594
edits
Notmyhandle (talk | contribs) (→Creating a template: addition, added Documentation Subpages section) |
(added onlyinclude, nowiki'd tagnames --> entities for < and >) |
||
Line 19: | Line 19: | ||
Rules for creating a documentation subpage: | Rules for creating a documentation subpage: | ||
*The page must be titled "Documentation" - for example: {{t|Infobox/Documentation}}. | *The page must be titled "Documentation" - for example: {{t|Infobox/Documentation}}. | ||
*The subpage should not be categorized, however the template's categories should be listed here, surrounded by | *The subpage should not be categorized, however the template's categories should be listed here, surrounded by <includeonly> tags. | ||
*{{t|Documentation subpage}} should be placed at the top. | *{{t|Documentation subpage}} should be placed at the top. | ||
Line 64: | Line 64: | ||
==Control template inclusion== | ==Control template inclusion== | ||
You can control template inclusion by the use of <code>< | You can control template inclusion by the use of <code><noinclude></code>, <code><includeonly></code> and <code><onlyinclude></code> tags. | ||
<code> | |||
Anything between <code> | Anything between <code><noinclude></code> and <code></noinclude></code> will be processed and displayed only when the page is being viewed directly, not included. | ||
displayed only when the page is being viewed directly, not included. | |||
Possible applications are: | Possible applications are: | ||
Line 75: | Line 73: | ||
* Explanatory text about how to use the template | * Explanatory text about how to use the template | ||
The converse is <code> | The converse is <code><includeonly></code>. Text between <code><includeonly></code> and <code></includeonly></code> will be processed and displayed only when the page is being included. The obvious application is to add all pages containing a given template to a category. | ||
<code> | |||
being included. The obvious application is to add all pages containing a given template to a category. | <code><onlyinclude></code> is somewhat different. Anything between | ||
<code><onlyinclude></code> and | |||
<code></onlyinclude></code> displays everywhere, but everything outside of it is treated as if it was wrapped in | |||
<code><noinclude></code> tags (so only the stuff in the onlyinclude is included on other pages). | |||
Note that the usual update problems apply -- if you change the | Note that the usual update problems apply -- if you change the |