Template:Category handler/doc: Difference between revisions

Ganaram inukshuk (talk | contribs)
No edit summary
Ganaram inukshuk (talk | contribs)
No edit summary
Line 3: Line 3:
{{clear}}
{{clear}}
{{lua}}
{{lua}}
'''Template:Category handler''' is intended as a metatemplate that helps templates categorize pages. It also suppresses categories depending on the namespace or subpage.
== Usage ==
Categories are entered as unnamed parameters, as shown.
<pre>{{Category handler | cat 1 | cat 2 | cat 3 }}</pre>
For example, the code below
: <code><nowiki>{{Category handler | Abstract MOS patterns | 8-tone scales}}</nowiki></code>
categorizes the page under the following categories.
: <code><nowiki>[[Category:Abstract MOS patterns]][[Category:8-tone scales]]</nowiki></code>
For testing purposes, categories can be turned off by adding <code><nowiki>debug=1</nowiki></code>. Modifying the previous example
: <code><nowiki>{{Category handler | Abstract MOS patterns | 8-tone scales | debug=1 }}</nowiki></code>
disables categories. Typical use as part of another template should instead use something like <code><nowiki>debug={{{debug|}}}</nowiki></code>, so that <code><nowiki>debug=1</nowiki></code> can be added to an instance of that template.