Template:Doc/Template: Difference between revisions
From Halopedia, the Halo wiki
No edit summary |
m (Protected "Template:Doc/Template" ([Edit=Allow only Halopedia staff] (indefinite) [Move=Allow only Halopedia staff] (indefinite))) |
||
(2 intermediate revisions by 2 users not shown) | |||
Line 5: | Line 5: | ||
__TOC__ | __TOC__ | ||
{{#ifexist:TemplateDoc:{{PAGENAME}}|{{TemplateDoc:{{PAGENAME}}}}|This template has no associated documentation. Would you like to [[TemplateDoc:{{PAGENAME}}|create it?]]}} | {{#ifexist:TemplateDoc:{{PAGENAME}}|{{TemplateDoc:{{PAGENAME}}}}|This template has no associated documentation. Would you like to [[TemplateDoc:{{PAGENAME}}|create it?]]}} | ||
}}</includeonly><noinclude>{{ | }}</includeonly><noinclude>{{Doc/Template}} [[Category:Documentation templates]]</noinclude> |
Latest revision as of 09:04, February 6, 2024
Usage
This template is used to automatically insert the relevant template documentation into a template page. It will automatically transclude the associated page in the TemplateDoc
namespace, or display a notice encouraging the user to create one, if there is no such page.
It should be transcluded at the end of all pages in the Template
namespace, within <noinclude>
blocks like so:
<includeonly> ... template code here ... </includeonly><noinclude>{{Doc/Template}} [[Category:Relevant template category]]</noinclude>
It does not require any arguments to be passed - it will generate all of the necessary links and template transclusions automatically using MediaWiki magic words.
Example
Unfortunately, an example of this template in action cannot be shown on this page, because doing so would cause an infinite loop of transclusions. However, examples of this template's use should be abundant on other template pages. One such example can be seen on Template:*.