Template:Categoritza
Template:Template doc start Template:Template informational
Template:Categoritza is a maintenance and navigation template on test2.wikipedia designed to help editors quickly add one or more categories to a page in a consistent way.
This template is usually used on talk pages, user pages, documentation subpages, and other non-mainspace pages where lightweight categorization is helpful. It can also serve as a wrapper around more complex categorization systems.
Usage
[edit]Place the template at the bottom of the page you want to categorize:
{{Categoritza|Category name 1|Category name 2|...}}
Example:
{{Categoritza|Example maintenance templates|Sandbox pages}}
This will add the page to:
- [[Category:Example maintenance templates]]
- [[Category:Sandbox pages]]
Parameters
[edit]- 1, 2, 3, ...
- Unnamed positional parameters. Each parameter is treated as the name of a category.
- nocat
- Optional flag. When set to
yes, the template will not categorize the page but will instead display the category names as plain text. This is often useful in documentation and examples. - Example:
{{Categoritza|Example maintenance templates|nocat=yes}}
Examples
[edit]Basic example
[edit]{{Categoritza|Template documentation|Test templates}}
Result:
- The page is added to
- The page is added to
With many categories
[edit]{{Categoritza
| Experimental templates
| Internal documentation
| Test2-only templates
}}
Result:
In documentation pages
[edit]On template documentation subpages (/doc pages), you can combine this template with <includeonly>...</includeonly> so that categorization only applies to the template itself and not to pages that transclude the documentation.
Example on Template:Example/doc:
<includeonly>{{Categoritza|Example templates|Template examples}}</includeonly>
Technical details
[edit]Internally, this template takes each positional parameter and wraps it in a standard category link of the form:
[[Category:{{{1}}}]]
It then repeats this for all additional parameters (2, 3, 4, etc.). Parameters that are empty or contain only whitespace are ignored.
The nocat parameter is checked before any categories are emitted. If nocat=yes, the template outputs the list of categories in a human-readable form for demonstration and testing purposes.
See also
[edit]- Template:Category handler – a more advanced system for conditional categorization
- Help:Category – help page about categories on test2.wikipedia
- Special:Categories – list of all categories
- Wikipedia:Maintenance – overview of maintenance-related tools and templates