Template:Categorize

From HorizonXI Wiki
Revision as of 16:13, 5 August 2024 by Aramachus (talk | contribs) (added option to disable documentation and categorization simultaneously)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Usage

  • First unnamed parameter: set to nc, no cat or no categories to force the template to do nothing. ndnc or ncnd will also work, intended with Template:Preview Only Infobox to disable categorization and documentation at the same time.
  • Second unnamed parameter: put whatever is supposed to happen if the first parameter is not set to one of the above.
  • Note: The template will also do nothing if the page has a namespace other than the main namespace or the namespace "Category". E.g. in the namespace "Template" it will do nothing.

The actual usage of the template is intended for categorization, as the name suggests. It allows to control categorization in other templates by forwarding the first unnamed parameter.

Example:

If a template "NPC" contains the line

{{categorize|{{{1|}}}|[[Category:NPC]]}}

Then a call like

{{NPC|nc
...
}}

will put the nc into the categorize template and cause it to do nothing.

A call like

{{NPC
...
}}

without specifying the first unnamed parameter in a way that Template:categorize processes it will make Template:categorize do whatever is in its second unnamed argument. In this example, this is apply [[Category:NPC]].

Designing templates in this way allows to control categorization at template call, e.g. for use on example pages.