Template:Dochead/doc: Difference between revisions

ArrowHead294 (talk | contribs)
mNo edit summary
No edit summary
Line 7: Line 7:
On modules, unless <code>header=none</code> is passed, a header will appear to inform users that modules should be called via templates instead of being invoked directly:
On modules, unless <code>header=none</code> is passed, a header will appear to inform users that modules should be called via templates instead of being invoked directly:


'''Note:''' Do not invoke this module directly; use the corresponding template instead: [[mw:Help:Magic words#Page names|Template:<nowiki>{{ROOTPAGENAME}}</nowiki>]].
<blockquote>'''Note:''' Do not invoke this module directly; use the corresponding template instead: [[mw:Help:Magic words #Page names|Template: <nowiki>{{ROOTPAGENAME}}</nowiki>]].</blockquote>


where <code>ROOTPAGENAME</code> is a [[mw:Help:Magic words|"magic word"]] that returns the name of the page without the namespace or subpages.
where <code>ROOTPAGENAME</code> is a [[mw:Help:Magic words|"magic word"]] that returns the name of the page without the namespace or subpages. This way, the link in the header will attempt to point to a template with the same name as the module, since this is mostly the case. If the template which calls the module has a different name, pass in <code>temp=</code> followed by the name of the template.  


This way, the link in the header will attempt to point to a template with the same name as the module, since this is mostly the case. If the template which calls the module has a different name, pass in <code>temp=</code> followed by the name of the template.
You can also directly specify the header using the <code>header</code> parameter.  


=== See also ===
=== See also ===
* [[Template: Documentation]] – inserts a documentation section onto a template or module.
* [[Template: Documentation]] – inserts a documentation section onto a template or module.
* [[Template: Doc head Wikipedia]] – similar template, used mainly for templates borrowed from Wikipedia.
* [[Template: Doc head Wikipedia]] – similar template, used mainly for templates borrowed from Wikipedia.